Java Convert Octal to DecimalWe can convert octal to decimal in java using Integer.parseInt() method or custom logic. Java Octal to Decimal conversion: Integer.parseInt()The Integer.parseInt() method converts a string to an int with the given radix. If you pass 8 as a radix, it converts an octal string into decimal. Let us see the signature of parseInt() method: Let's see the simple example of converting octal to decimal in java. Test it NowOutput: 81 Let's see another example of Integer.parseInt() method. Test it NowOutput: 81 19 8 Java Octal to Decimal conversion: Custom LogicWe can convert octal to decimal in java using custom logic. Test it NowOutput: Decimal of 121 is: 81 Decimal of 23: 19 Decimal of 10 is: 8 ReferencesNext TopicJava Decimal to Octal |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India