139k views
1 vote
What is the output? int[] arr = new int[1]; arr[0] 10; System.out.printin(arr[O]): 01 OArrayIndexOutorBoundsException

User Rotem
by
6.8k points

1 Answer

4 votes

Answer:

Syntax Error.

Step-by-step explanation:

You are creating an array of size 1.There is no assignment operator for arr[0].It should be arr[0]=10.System.out.printin(arr[O]) it should be System.out.println(arr[0]) .If all these syntax are correct then the outputy should be 10 because we have arr[0]=10.But for the code provided the answer is Syntax error because this code has many errors.

User Stephen Woods
by
7.1k points