I have tried to use Arrays.asList() method on a character array,something like below,
char[] array = "programming".toCharArray();
for (Character li : Arrays.asList(array)) {
System.out.println(li);
}
But there was a compile time error. Here Array.asList is returning me a Array of character arrays like below
for (char[] li : Arrays.asList(array)) {
System.out.println(li);
}
What i know is, Arrays.asList() method converts each element of the array into an element in List . But whats going on here? can anybody help me in understanding this ?