public static void main(String[] args) {
int [] a1= new int[]{1,2,3};
int [][] a3= new int[][]{{1,3},{2,5},{6,5}};
String[] a4 = new String[]{"a","z","f"};
printObject("a111:"+a1);
printObject("a333:"+a3);
printObject("a444:"+a4);
printObject("xyz");
printObject(new int[]{1,2,3});
printObject(new String[]{"haha","hehe","dddd"});
}
private static void printObject(Object obj) {
Class arrclass = obj.getClass();
if(arrclass.isArray()){
int len = Array.getLength(obj);
for(int i=0;i<len;i++){
System.out.println(Array.get(obj,i));
}