What will be the output of the following program?

Last Updated :
Discuss
Comments

What will be the output of the following program?

Java
int[] arr = {1, 2, 3, 4, 5};
System.out.println(arr.length);

4

5

6

Compilation Error

Share your thoughts in the comments