As you have a 2-d array, you have two length values for each loop:
//you have this? array[][];
for(int i = 0; i < array.length; ++i) {
for(int j = 0; j < array[i].length; ++j) {
//do something on array[i][j]
}
}
More Related Contents:
- How does array work? How to create a basic array data structure using java? [closed]
- How to combine a String of arrays to one string using loops? [duplicate]
- Is there a way to check for a char in all elements of an array?
- Does Java JIT compiler sacrifice performance to favor Collections?
- Android String that change every day
- How can I convert List to int[] in Java? [duplicate]
- How to add new elements to an array?
- Array initialization syntax when not in a declaration
- What is the default initialization of an array in Java?
- “Code too large” compilation error in Java
- how to parse JSONArray in android
- Resize an Array while keeping current elements in Java?
- java Arrays.sort 2d array
- Java count occurrence of each item in an array
- How to convert an Array to a Set in Java
- How do I convert a byte array to Base64 in Java?
- What is the diamond operator in Java? [duplicate]
- Java, find intersection of two arrays
- Java, Simplified check if int array contains int
- Working with a List of Lists in Java
- Dealing with an ArrayStoreException
- How to get String Array from arrays.xml file
- Passing directly an array initializer to a method parameter doesn’t work
- Find an array inside another larger array
- how to write an array to a file Java
- Java: Reading integers from a file into an array
- Sort ArrayList of Array in Java
- Arrays.asList() of an array
- Easiest way to convert a Blob into a byte array
- Compare two arrays of primitives in Java?