![]() |
VOOZH | about |
The java.lang.Integer.toString() method is an inbuilt method in Java used to convert an integer value into its corresponding String representation. The Integer class provides multiple overloaded versions of this method for different use cases.
This method returns a String object representing the value of the current Integer object.
public String toString();
Example: This example shows how to convert an Integer object into a String using the toString() method in Java.
25
Explanation:
This method returns a String representation of the specified integer value.
public static String toString(int a);
Example: This example demonstrates how to convert a primitive integer value into a string using the Integer.toString() method.
-787
Explanation:
This overloaded method returns a string representation of the integer a in the specified radix (base).If the base is less than Character.MIN_RADIX (2) or greater than Character.MAX_RADIX (36), base 10 is used by default.
public static String toString(int a, int base);
Example: This example demonstrates how to convert an integer value into a string using different number bases (radix).
1000111 13a
Explanation: