Say I have some Java code:
public class Widget {
...whatever
}
And some code that classloads the Widget
:
ClassLoader widgetLoader = Widget.class.getClassLoader();
Can widgetLoader
ever be null
? Why/why not? If so, under what circumstances?
According to this method javadoc:
Returns the class loader for the class. Some implementations may use null to represent the bootstrap class loader. This method will return null in such implementations if this class was loaded by the bootstrap class loader.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다