Hello,
I don't really understand how the 2D array works here. Why can't we take a normal array?
Can someone explain this?
Is there any other way to convert String array to char array?
Thank you!
String[] arr = { "apple", "banana" };
char[][] cs= new char[arr.length][];
for (int i = 0; i < arr.length; i++) {
String string= arr[i];
for (int j = 0; j < string.length(); j++) {
cs[i] = string.toCharArray();
}
}