Null keyword

Is null a keyword? if not what is it?

Questions by gkumawat

Editorial / Best Answer

interviewprep9  

  • Member Since Jun-2008 | Jun 14th, 2008


Capital N, Null is not a keyword or a reserved word.

All small letters, null is not a keyword either. but, it's a reserved word. you cannot use null as follows:

String null = "a";

null means that a reference is not pointing to any object.

Showing Answers 1 - 24 of 24 Answers

Capital N, Null is not a keyword or a reserved word.

All small letters, null is not a keyword either. but, it's a reserved word. you cannot use null as follows:

String null = "a";

null means that a reference is not pointing to any object.

vegetto

  • Jun 15th, 2008
 

Null is not a keyword but

null is a keyword but it is not a good programming practise that u use variavles that

may be close to some keywords .

Null is a variable that can hold any of the value;
while  null means nothing or empty;
it is used to specify the objects that do not point anything
eg:
Myclass ob=null; //null object
or String s1=null;

  Was this answer useful?  Yes

Uma Sundar

  • Jun 16th, 2008
 

Null is not a keyword.Null is a default value for all type of reference variables.Null means "nothing" in a specified variable.

  Was this answer useful?  Yes

s.sachin11

  • Jun 25th, 2008
 

"null" is not a keyword, but a special literal of the null type. It can be cast to any reference type, but not to any primitive type such as int or boolean. The null literal doesn't necessarily have value zero. And it is impossible to cast to the null type or declare a variable of this type.

  Was this answer useful?  Yes

Sarje

  • Aug 17th, 2009
 

Null is not a keyword but null is reserved literal. null is the default value for instance variable.
String str = null;
means instance variable str does not hold reference of any object.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions