java tutorial - Java toString () method - java programming - learn java - java basics - java for beginners
Learn Java - Java tutorial - Java numbers to string - Java examples - Java programs
Description
- The toString () method is used in Java to obtain a string object representing the value of a numeric object, in other words, it converts a number to a string.
- If the method takes a simple data type as an argument, object that represents the value of a simple data type.
- If the toString () method in Java takes two arguments, the string representation of the initial argument in the number system on the integer base identified by the next argument will be returned.
Syntax
The whole variant of the method is given below:
Options
Detailed information about the parameters:
- i - int, which will be changed and returned as string object (String).
Return value
- toString (): Returns a string object representive the value of this integer.
- toString (int i): returns a string object representive the identified integer.