JAVA获取对象类名

对象名.getClass(),与类名.class所得到的字符串相同:

String a = new String("aaa");
System.out.println(a.getClass() == String.class);    //返回true
posted @ 2019-03-07 23:38  epiphanyy  阅读(12)  评论(0)    收藏  举报  来源