publicclass Main {
publicstaticvoid main(String args[]) {
String[][] data = new String[3][4];
System.out.println(getDimension(data));
}
publicstaticint getDimension(Object array) {
int dim = 0;
Class c = array.getClass();
while (c.isArray()) {
c = c.getComponentType();
dim++;
}
return (dim);
}
}
//2