answersLogoWhite

0

I think you're referring to the C/C++ concept of "dangling pointers." This is when you allocate some memory to a pointer, then deallocate that memory, but don't change the pointer. This causes any attempted use of the pointer to return an unused memory address.

There is no such concept in Java, since the programmer has little to no control over how memory is allocated or freed.

The closest thing I can think of is if you're using a class such as a Reader, in which you can close the object (Reader.close()) and then still have a reference to it. But in this case (and other similar cases) attempting to use the Reader further will result in an IOException being thrown.

User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

Define dangling if in terms of java?

A dangling reference is less problematic in Java, because the garbage collector will eventually delete any object that is unreachable. So, even if one object has a reference to a second object, and the second has a reference to the first object, they would eventually be destroyed if they are unreachable from the objects referenced on the stack.A dangling reference is less problematic in Java, because the garbage collector will eventually delete any object that is unreachable. So, even if one object has a reference to a second object, and the second has a reference to the first object, they would eventually be destroyed if they are unreachable from the objects referenced on the stack.A dangling reference is less problematic in Java, because the garbage collector will eventually delete any object that is unreachable. So, even if one object has a reference to a second object, and the second has a reference to the first object, they would eventually be destroyed if they are unreachable from the objects referenced on the stack.A dangling reference is less problematic in Java, because the garbage collector will eventually delete any object that is unreachable. So, even if one object has a reference to a second object, and the second has a reference to the first object, they would eventually be destroyed if they are unreachable from the objects referenced on the stack.


Does java support call by reference?

No , Java does not support call by reference.


What are the differences between C and Java reference variables?

Java does not have the concept of Reference Variables. We cannot access the memory location where the data is stored in Java.


Which is the best Book to understand JAVA in short?

You can use Head First Java or Java Complete Reference to learn Java.


What is the best book of java language?

the best book of java is java complete Reference 2nd edition.


What has the author Patrick Niemeyer written?

Patrick Niemeyer has written: 'Learning Java' -- subject(s): Java (Computer program language) 'Learning Java' -- subject(s): Java (Computer program language), Java (programmeertaal) 'Java Reference Library on the Web'


What does the 'this' reference do in Java?

Represents the current object (not usable in static methods).


In java all variables declared using a class are?

Reference variables


How do you use the word dangling in a sentence?

The climber was left dangling for his life on the edge of the cliff.She did not like the way the bracelet was dangling when she drove.Somehow, there is a sock dangling from the tree.


How can you study easy to develop applications using java?

There is a good book called Java - The Complete Reference. This would be a good place to start.


Why pass by reference is quicker than pass by values in java?

Pass by Reference does not create a copy of the data items. So, it is faster.


Difference between reference and object in java?

On the lower level of Java, a "reference" can be thought of like a pointer in C. It is essentially an integer which refers to (points to) a location in memory where the object data exists. // "button" is a reference to a JButton with a "1" on it (the object). JButton button = new JButton("1");


What is the antonym of dangling?

The antonym of "dangling" could be "secure" or "fixed."


What is the difference between reference and hashcode?

There is no relation between reference and hascode, Java reference is unique pointer which refers an object. so each object will have a unique reference. but 2 diff object can have same hashcode.


How do you delete reference of an object in java?

You can't really delete a reference to an object. You can set the reference to null, which will eventually cause the garbage collector to free up the memory from that reference, but you cannot explicitly delete anything.


What is an antonym for dangling?

The antonym for dangle is dangling


What are the different parameter passing methods used by c plus plus?

Pass by value, constant value, reference and constant reference. Pass by value is the default in C++ (pass by reference is the default in Java).


What is a sentence for the word dangling?

The man was dangling from the bridge for his life


When was Dangling Man created?

Dangling Man was created in 1944.


Does java come with Windows XP?

No, you will have to download it from either online or get a game to reference you to it. I suggest you get it from download cnet.com