- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Java Program to convert decimal integer to octal number
Use the toOctalString() method to convert decimal to octal. It returns a string representation of the integer argument as an unsigned integer in base 8. The following characters are used as octal digits: 01234567.
First, declare an int value, which you want to convert to octal.
int val = 99;
Now convert it to octal using the toOctalString() method.
Integer.toOctalString(val);
Example
public class Demo { public static void main( String args[] ) { int val = 99; // converting to octal System.out.println(Integer.toOctalString(val)); } }
Output
143
- Related Articles
- Java Program to convert octal number to decimal number
- Convert decimal integer to octal in Java
- Java program to convert decimal number to octal value
- Java program to convert float decimal to Octal number
- Java Program to convert Decimal to Octal
- Java Program to convert integer to octal
- Convert octal number to decimal number in Java
- C# program to convert decimal to Octal number
- Java Program to convert decimal integer to hexadecimal number
- Python program to convert float decimal to octal number
- Golang Program to convert Decimal to Octal
- Swift Program to convert Decimal to Octal
- C++ Program to convert Octal Number to Decimal and vice-versa
- C++ Program to convert Decimal Numbers to Octal
- Convert decimal integer to hexadecimal number in Java

Advertisements