Java toString() Method
The toString() method is used to return a String object representing the specified char value. The result is a string of length 1, consisting only of the specified char.
Syntax
String toString(char ch)
Parameters
-
ch -- The character to be converted.
Return Value
Returns the string representation of the specified char value.
Example
public class Test {
public static void main(String args[]) {
System.out.println(Character.toString('a'));
System.out.println(Character.toString('A'));
}
}
The execution result of the above program is:
a
A
Java Character Class