Check out example codes for "octal to binary in java". It will help you in understanding the concepts better.

Code Example 1

import java.util.Scanner;
public class OctalToBinaryJava
   public static void main(String[] args)
      Scanner sc = new Scanner(;
      System.out.println("Please enter octal number: ");
      int octal = Integer.parseInt(sc.nextLine(), 8);
      String strBinary = Integer.toBinaryString(octal);
      System.out.println("Binary value is: " + strBinary);

Learn ReactJs, React Native from