1、Java代码
public class TreflectionZ { public static void main(String[] args) throws Exception { Class classInt1 = int.class; Class classInt2 = Class.forName("java.lang.Integer");
System.out.println("classInt1 : "+classInt1+" , "+classInt1.hashCode()); System.out.println("classInt2 : "+classInt2+" , "+classInt2.hashCode()); if (classInt1 == classInt2) System.out.println("classInt1 == classInt2"); else System.out.println("classInt1 != classInt2"); } }
2、控制台输出:
classInt1 : int , 23660326
classInt2 : class java.lang.Integer , 5538765
classInt1 != classInt2
3、