The toString() method of Java Integer class returns a String object which represents this Integer’s value.

The second syntax returns a String object which represents the specified integer.

The third syntax returns a string representation of the specified argument in the radix specified by the given radix.


  • public String toString ()
  • public static String toString (int i)
  • public static String toString (int i, int radix) 


The parameter ‘i’ represents an integer to be converted to a string and the parameter ‘radix’ represents the radix to use in the string representation.

Return Value

This method returns a String which represents the same value as this argument in base 10 or in the specified radix.

Example 1


Example 2


Example 3


Example 4


Pin It on Pinterest

Share This