0% found this document useful (0 votes)
58 views1 page

Java Constructor and Null Pointer Errors

The document notes that in Java, if a constructor is declared for a class, there will be no default constructor provided, creating an object of that class without calling a constructor will result in a null pointer exception at runtime, and importing the java.lang package can cause runtime errors.

Uploaded by

arunsmile
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views1 page

Java Constructor and Null Pointer Errors

The document notes that in Java, if a constructor is declared for a class, there will be no default constructor provided, creating an object of that class without calling a constructor will result in a null pointer exception at runtime, and importing the java.lang package can cause runtime errors.

Uploaded by

arunsmile
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

NOTE: in java suppose we declare any constructor there will not be any default

const. for that class.


NOTE: class_name obj; //just this will give runtime error nullpointer
NOTE: package [Link]; // Runtime gives error
NOTE:

You might also like