I need to get the length of a 2D array for both the row and column. I’ve successfully done this, using the following code:
public class MyClass { public s
String [][] example = {{{"Please!", "Thanks"}, {"Hello!", "Hey", "Hi!"}}, {{"Why?", "Where?", "When?", "Who?"}, {"Yes!"}}};
example.length;
= 2
example[0].length;
example[1].length;
example[0][1].length;
= 3
example[1][0].length;
= 4