【发布时间】:2021-06-07 00:49:51
【问题描述】:
public static void main(String[] args)
{
// Let's print the classloader name of current class.
//Application/System classloader will load this class
Class b= int.class;
Class c=ClassLoaderExample.class;
ClassLoaderExample a= new ClassLoaderExample();
System.out.println(c);
}
这里的 .class 是什么以及它指定了什么? c 和 a 不同吗?
【问题讨论】:
-
据此,a和c都是ClassLoaderExample类的对象,那为什么a.getCalss和c.getClass的输出不同呢?
-
不,和上面一样。但并没有消除我的困惑。我试图理解。可能是我的把握力低,但我还是不清楚。
标签: java