What will be the output of the following code?

Last Updated :
Discuss
Comments

What will be the output of the following code?

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

1

2

3

4

Share your thoughts in the comments