How to convert decimal primitive int to octal number in String object in Java

1 Answer

0 votes
package javaapplication1;

public class JavaApplication1 {

    public static void main(String[] args) {

        int decimal = 15;

        String sOctal = Integer.toOctalString(decimal);
               
        System.out.println(sOctal);
    }
}
   
/*
      
run:
      
17
  
*/

 



answered Nov 7, 2016 by avibootz
...