//1.调用运行时类本身的.class属性 Class<Person> class1 = Person.class; System.out.println(class1); //2.通过运行类的对象获取 Person person = new Person(); Class class2 = person.getClass(); System.out.println(class2.getName()); System.out.println(person); // 3.通过class静态方法获取 Class class3 = Class.forName("com.mbang.Person"); //4.通过类加载器 ClassLoader classLoader = this.getClass().getClassLoader(); classLoader.loadClass("com.mbang.Person");