Mega Code Archive

 
Categories / Java / Collections Data Structure
 

Using the length Variable

//The length variable is used to access the length of the firstrowof a  //two dimensional array. public class TestLength {   public static void main(String args[]) {     int[][] multiD = {       { 1, 2, 3, 4 },       { 5, 6, 7 }     };              System.out.println("The length of the first row is "+multiD[0].length);   } }