1// conversion of binary to octal in java..
2public class Main{
3 public static void main(String args[]) throws Exception{
4 String binary = "1100100"; // binary number..
5 int decimal = Integer.parseInt(binary,2); // converting binary to decimal
6 System.out.println(Integer.toOctalString(decimal)); // 144 <= octal output..
7 }
8}