getting string as array in java code example
Example 1: java string to char array
String str = "example";
char[] ch = str.toCharArray();
Example 2: string array in java methods
String[] vowels = { "a", "e", "i", "o", "u" };
System.out.println(vowels);
System.out.println(Arrays.toString(vowels));