Java Integer.toString(int i, int radix)
Syntax
Integer.toString(int i, int radix) has the following syntax.
public static String toString(int i, int radix)
Example
In the following code shows how to use Integer.toString(int i, int radix) method.
public class Main{
public static void main(String[] args) {
System.out.println(Integer.toString(100,2));
System.out.println(Integer.toString(100,8));
System.out.println(Integer.toString(100,10));
System.out.println(Integer.toString(100,16));
}// ww w . j ava 2s .co m
}
The code above generates the following result.