Java - Arrays
What will be printed by the following Java code?
char[] letters = {'a', 'b', 'c', 'd'};
System.out.println(letters.length);char[] letters = {'a', 'b', 'c', 'd'};
System.out.println(letters.length);letters has 4 elements: 'a', 'b', 'c', 'd'.letters.length returns the number of elements, which is 4.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions