how to drop object reference in java?

Recommended Answers

Assign the special value null to the reference variable.

For more info - tutorial.

var=null;
Jump to Post

All 2 Replies

Assign the special value null to the reference variable.

For more info - tutorial.

var=null;

I dont think it will drop the refference, it will create garbage.. First let us know what you require..?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.