Question

2. (5 points) Java provides a WeakHashMap and C++ permits weak_ptr objects. How do these weak references differ than than the

0 0
Add a comment Improve this question Transcribed image text
Answer #1

When we create an object for any class we have a soft link with the object
Ex:
Animal a = new Animal()
Above we have animal object which has softlink with a
In Java any object which has no softlink is called weak references so JVM will run the garbage collection and
removes all the objects which has weak references
a=null;
not the animal object has no soft link with anything

we dont suggest to use weak references any where

Add a comment
Know the answer?
Add Answer to:
2. (5 points) Java provides a WeakHashMap and C++ permits weak_ptr objects. How do these weak...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT