Convert Octal String to Decimal Number using Java

Integer.parseInt method

package app;

public class Main
{
    public static void main(String[] args)
    {
        String octalString = "50";
        int decimalNumber = Integer.parseInt(octalString, 8);

        System.out.println(decimalNumber);
    }
}

Leave a Comment

Cancel reply

Your email address will not be published.