GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  J2EE  >  Core Java
Go To First  |  Previous Question  |  Next Question 
 Core Java  |  Question 483 of 502    Print  
Null keyword
Is null a keyword? if not what is it?


  
Total Answers and Comments: 8 Last Update: August 17, 2009     Asked by: gkumawat 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: interviewprep9
 
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.


Above answer was rated as good by the following members:
timmireddy, pravinsharma, tanzeem khan, raghu.emails, roger30
June 14, 2008 13:47:17   #1  
interviewprep9 Member Since: June 2008   Contribution: 10    

RE: Null keyword
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.

 
Is this answer useful? Yes | NoAnswer is useful 5   Answer is not useful 0Overall Rating: +5    
June 15, 2008 08:39:14   #2  
vegetto Member Since: June 2008   Contribution: 10    

RE: Null keyword
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;

 
Is this answer useful? Yes | NoAnswer is useful 0   Answer is not useful 2Overall Rating: -2    
June 16, 2008 16:45:42   #3  
Uma Sundar Member Since: June 2008   Contribution: 2    

RE: Null keyword
Null is not a keyword.Null is a default value for all type of reference variables.Null means "nothing" in a specified variable.
 
Is this answer useful? Yes | NoAnswer is useful 0   Answer is not useful 2Overall Rating: -2    
June 25, 2008 06:04:54   #4  
s.sachin11 Member Since: June 2008   Contribution: 1    

RE: Null keyword
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.
 
Is this answer useful? Yes | No
July 17, 2008 06:55:57   #5  
timmireddy Member Since: May 2008   Contribution: 17    

RE: Null keyword
Null is not a keyword but this is a special string literal of null type means there is no specific use of null.If u use null as an reference it won't work JVM shows it's not a statement.
 
Is this answer useful? Yes | No
August 03, 2008 01:43:43   #6  
er.mukesh_208 Member Since: May 2008   Contribution: 3    

RE: Null keyword
null is neither keyword nor any special literial. It is only a reserved word.
 
Is this answer useful? Yes | NoAnswer is useful 0   Answer is not useful 1Overall Rating: -1    
September 13, 2008 09:14:03   #7  
varmasuman Member Since: September 2008   Contribution: 1    

RE: Null keyword
Null means showing nothing

Whenever one object reference refers null i.e

ServletConfig application null;

Then there is nothing in the object reference application.

 
Is this answer useful? Yes | NoAnswer is useful 2   Answer is not useful 0Overall Rating: +2    
August 17, 2009 10:37:57   #8  
Sarje Member Since: August 2009   Contribution: 62    

RE: Null keyword
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.

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape