answersLogoWhite

0

What does null means in java?

Updated: 8/10/2023
User Avatar

Wiki User

11y ago

Best Answer

Null is a value that any variable can have. It means the absence of a value. However, null can only be assigned to object reference variables; attempting to execute a method on a null variable will cause the JVM to throw a NullPointerError.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

It means empty. It is the value which pointers to objects have, when they don't point to an actual object.

For example:

MyClass x;

/* Here, variable is designed to point to an object of the class "MyClass", but it doesn't point to such an object yet. */

x = new MyClass();

/* Now, the object has been created, and x points to this object. */

x = new MyClass();

/* A second object is created, and x points to this second object. The first object is inaccessible. Inaccessible objects will eventually be deleted by the garbage collector. */

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

No null is not a keyword. null is considered to be a "literal" in Java.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

You write "null" not NULL in Java.

eg

String testString=null;

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

null does not stand for anything, it simply is a computer term for a non-value

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What does null means in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is meant by Java Lang nullpointerexeption?

The expression is termed for an error in the Java Script software provided by Oracle. It means that one of the variables passing is null, but the code still tries to use it.


Java null pointer exceptions?

A null pointer exception in java comes when you are trying to perform any action on an object that isnt initialized/has a value i.e., is a NULL Value Ex: private String s; //declare a string if(s.equals("test")){ //do something.. } You will get a null pointer in the if condition because you are checking a value that is null which is not allowed..


What is literal in java programming?

Literal in java are L, F, null, true, false These act as keyword(have special meaning in java) but these does'nt comes under the category of Java Keyword.


What is java string?

array of character data type which is terminated by null character


Are true false and null Java keywords?

True and false are literals(special built-in value) in java and cannot be used as keywords.


Length of a null string is supposed to be 1?

A null has no length... I dont know java or c but in sql and vb there are functions to convert nulls isnull(some_field,' ') would return either the field, or a space if its null


How do you initialize variable?

initialize simple types: int i = 0; initialize objects: Object o = null; (in java)


Can NullPointerException be used with ArithmaticException using throws keyword in java?

No. You cannot throw or catch Null pointer exceptions


Can you have an empty Integer value in java?

No. It has to be either NULL (Not yet Instantiated) or 0. Numeric objects cannot be empty.


How can you fix uncaught exception java lang Null Pointer Exception on blackberry 8300?

The best way to fix uncaught exception java lang Null Pointer Exception on a Blackberry 8300 is by doing a restart. Shut the phone off and remove the battery for a minute. Replace the battery and turn the phone back on.


What is correct and safe declaration of NULL?

Null means nought, zero, nil, nothing, etc.


What is a nulligravida?

no pregnancy null means no gravida means pregnant