public class LoaderDifference {
public static void main(String[] args) throws ClassNotFoundException {
ClassLoader classLoader = Robot.class.getClassLoader();//延迟加载,不进行初始化,不初始化static块
Class.forName("com.mall.controllor.portal.Robot");//加载完成static块,比如
Class.forName("com.mysql.jdbc.Driver");//Driver中有个静态块,加载一些初始化信息
}
}