Home Help Java N The null keyword



The null keyword
Posted on: May 27, 2009 at 12:00 AM
The null keyword in java programming language is a reserved word that is used to represent no value.

The null keyword

     

The null keyword in java programming language is a reserved word that is used to represent no value. Keywords are basically reserved words which have specific meaning relevant to a compiler.

Syntex:  Here is the syntax that displays how to declare and define null values in java programming language.

Integer a;

a = null;

String str;

if (str != null)

{

<statements>

}

Note: Here are some points that must be considered while declaring and assigning a value to a variable.

  • Assigning a null value to a non-primitive type variable releases the object to which the variable previously referred.

  • Primitive data types such as byte, short, int, long, char, float, double, boolean cannot have a null type.

Related Tags for The null keyword:
ccomcompilerantwordcompilekeykeywordspilbasicifcallkeywordmpitoicalciwordseilpeincalasmntcaesspecallpimemeanrelwhichsspkhalleaarspecificreservedrdsrvvassrdavevaevaicaicaomo


More Tutorials from this section

Ask Questions?    Discuss: The null keyword  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.