{
public static void main (String[] args)
{
int[] arr = new int[2];
arr[0] = 10;
arr[1] = 20;
for (int i = 0; i <= arr.length; i++)
System.out.println(arr[i]);
}
Answers
Answered by
5
Answer::
It will print 20 as your output.
Reason ::
==> The value of i has became 1 and as it asks to print the array, the 2nd value will be printed.
Note : - Arrays start at 0.
Hope this helps you.
Similar questions
English,
1 month ago
English,
1 month ago
Physics,
2 months ago
Math,
10 months ago
Computer Science,
10 months ago