Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

nullpointerexception

public class MyClass{
	private Object iAmNull;//This is null by default
    private Object iAmInitialized=new Object();
    public void test(){
    	System.out.println(iAmInitialized.toString());//prints that object
        System.out.println(iAmNull.toString());//throws a NullPointerException
    }
}
Source by jamesdreaming.tistory.com #
 
PREVIOUS NEXT
Tagged: #nullpointerexception
ADD COMMENT
Topic
Name
4+7 =