1String string = "ABCDEF" ;
2
3char[] charsFromString = string.toCharArray(); // { 'A', 'B', 'C', 'D', 'E', 'F' }
1// Convert char to string java
2public class CharToStringJava
3{
4 public static void main(String[] args)
5 {
6 char ch ='G';
7 String str = Character.toString(ch);
8 System.out.println("char to string is: " + str);
9 }
10}
1// getting single character from string..
2String str="abcd";
3
4char c=str.toChar(0);
5
6System.out.println("output is "+c); // output is a