Java compile-time vs. run-time

来源:互联网 发布:用js写html代码 编辑:程序博客网 时间:2024/05/16 01:26
See this class:

import org.apache.log4j.Logger;

public class A {
}

what will happen if we do not set the log4j.jar into classpath at compile-time and build-time respectively?
Answer:
Compile-time: FAIL
Run-time: SUCCEED! (dynamically classloading)
原创粉丝点击