to char arrray in java code example
Example 1: java string to char array
String str = "example";
char[] ch = str.toCharArray();
Example 2: java char array to string
final char[] charArray = { 'g','e','e','k','s','f','o','r','g','e','e','k','s' };
String string = new String(charArray);
System.out.println(string);
// -> "geeksforgeeks"