string toCharArray
// convert a string to an array of char
string.toCharArray
// how to go over all elements in array
for (char c : string.toCharArray) {
System.out.println(c);
}
// Another way
char[] array= str.toCharArray();
for(char c: array){
System.out.print(c);
}