More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know.
Ans. whenever a reference is created in Java without assigning the object
like
String str;
It get's assigned to null. So null provides a temporary memory location which any reference can point to till an appropriate object is assigned. Moreover it denotes that nothing has been assigned yet and hence provides a check in many cases.
Help us improve. Please let us know the company, where you were asked this question :