How to display equivalent octal values of an integer in Java

1 Answer

0 votes
public class MyClass {
    public static void main(String args[]) {
        int n = 13;
        
        System.out.println(Integer.toOctalString(n));
        
        System.out.println(Integer.toOctalString(255));
    }
}




/*
run:
 
15
377
 
*/

 



answered Sep 27, 2021 by avibootz
...