是介绍 getClass()方法
class objectType = pet.getClass(); //pet对象只要哪个类定义了,就指向那个类
system.out.println(objectType.getName());上面这代码居然不能运行,说是标识符有问题,想问下问题出在哪里??
class objectType = pet.getClass(); //pet对象只要哪个类定义了,就指向那个类
system.out.println(objectType.getName());上面这代码居然不能运行,说是标识符有问题,想问下问题出在哪里??
System.out.println(objectType.getName());
真的是因为Class没大写~~