String to char array in JAVA

String to array of characters in JAVA

public class StringToChar {

    public static void main(String args[]) {
        char[] array = "yami code".toCharArray();
        System.out.println(array.length);
        // Ouput: 9
    }

}