Convert character to String
static String toString(char c)
- Returns a String object representing the specified char.
String toString()
- Returns a String object representing this Character's value.
public class Main {
public static void main(String[] argv) {
Character character1 = new Character('a');
Character character2 = new Character('b');
System.out.println(character1.toString());
System.out.println(Character.toString(character2));
}
}
The output:
a
b