Reputation: 1544
how can we navigate through the two dimensional array without using nested loops.i.e by using only one loop.
String ar[][]=new String [3][4];
Upvotes: 13
Views: 6095
Reputation: 272467
Here's a hint:
int i = 9;
System.out.println(i / 4); // 2
System.out.println(i % 4); // 1
Upvotes: 20