Consider the following Java code,
public class FirstClass{
public static Object[][] firstMethod(){
Random random=new Random();
int a=random.nextInt(100);
int b=random.nextInt(100);
int n=0;
Object[][] arrayObj=new Object[a][b];
for(int i=0;i<a;i++)
for(int j=0;j<b;j++){
arrayObj[i][j]=++n;
}
return arrayObj;
}
}
public class SecondClass{
public void secondMethod(){
Object[][] myObj=FirstClass.FirstMethod();
}
}
How can I get dimensional length of 'myObj' from 'secondMethod()' and how to print 'myObj'
myObjfromsecondMethod()then uselengthproperty of the array to get size.