To convert
char
to String
in Java, use the Character.toString
function.Here's how you do it:
char aChar = 'a';
String aCharAsString = Character.toString(aChar);
System.out.println(aChar); // a
System.out.println(aCharAsString); // a