Java Data Type Tutorial - Java Integer.toOctalString(int i)








Syntax

Integer.toOctalString(int i) has the following syntax.

public static String toOctalString(int i)

Example

In the following code shows how to use Integer.toOctalString(int i) method.

public class Main {
  public static void main(String[] args) {
    System.out.println(Integer.toOctalString(7));
    System.out.println(Integer.toOctalString(8));
    System.out.println(Integer.toOctalString(9));
    System.out.println(Integer.toOctalString(10));
    System.out.println(Integer.toOctalString(100));
  }
}

The output: