# Which option represents the state of the num array after successful completion of the outer loop?

Given the code fragment:

Which option represents the state of the num array after successful completion of the outer loop?

A. Option A
B. Option B
C. Option C
D. Option D

## 2 thoughts on “Which option represents the state of the num array after successful completion of the outer loop?”

1. Govind Kande says:

in the second for loop condition is mentioned like num[i].length

2. Hack says:

public static void main(String[] args) {
int [][] num= new int [1][3];
for(int i =0 ; i<num.length;i++){
for(int j = 0;j<num.length;j++){
num[i][j]=10;
System.out.println(num[0][0]);
System.out.println(num[0][1]);
System.out.println(num[0][2]);
}
}
}
result
10
0
0

18
1. Hack says:

No sorry the answer is A
public static void main(String[] args) {
int [][] num= new int [1][3];
for(int i =0 ; i<num.length;i++){
for(int j = 0;j<num[0].length;j++){
num[i][j]=10;
System.out.println("num["+i+"]["+j+"]= "+num[i][j]);

output
num[0][0]= 10
num[0][1]= 10
num[0][2]= 10

17