方法一: 使用getClass()方法获取Class对象 public class Demo1 { public static void main(String[] args){ //创建一个Student类的对象 Student1 student1 = new Student1(); //通过getClass()方法获取Class对象 Class c1 = student1.getClass()