xxxxxxxxxx
char c = 'a';
String s = String.valueOf(c); // fastest + memory efficient
String s = Character.toString(c);
String s = new String(new char[]{c});
String s = String.valueOf(new char[]{c});
String s = new Character(c).toString();
String s = "" + c; // slowest + memory inefficient
xxxxxxxxxx
String string = "ABCDEF" ;
char[] charsFromString = string.toCharArray(); // { 'A', 'B', 'C', 'D', 'E', 'F' }
xxxxxxxxxx
// getting single character from string..
String str="abcd";
char c=str.toChar(0);
System.out.println("output is "+c); // output is a
xxxxxxxxxx
from character to string:
char c = 'a';
String s = Character.toString(c);
//s == "a"
xxxxxxxxxx
char[] chars = { 'A', 'B', 'C', 'D', 'E', 'F' };
String str1 = String.valueOf(chars); //"ABCDEF"
String str2 = new String(chars);// "ABCDEF"
System.out.println(str1.equals(str2)); //"true"