We can convert decimal to octal in java using Integer.toOctalString() method or custom logic.
The Integer.toOctalString() method converts decimal to octal string. The signature of toOctalString() method is given below:
Let's see the simple example of converting decimal to octal in java.
Output:
10 23 121
We can convert decimal to octal in java using custom logic.
Output:
Decimal to octal of 8 is: 10 Decimal to octal of 19 is: 23 Decimal to octal of 81 is: 121
We request you to subscribe our newsletter for upcoming updates.

We deliver comprehensive tutorials, interview question-answers, MCQs, study materials on leading programming languages and web technologies like Data Science, MEAN/MERN full stack development, Python, Java, C++, C, HTML, React, Angular, PHP and much more to support your learning and career growth.
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India