posted 21 years ago
If a method has a return type, either a primitive or an Object type or any other user-defined type, what happens to the return value if it is not used.
For eg., if I have a hashtable MyHash, I would use the put() method to fill it up. The put() has a return type of Object. However, I don't need the return type so I ignore it. Does the returned Object occupy any memory space...or is it garbage collected if it is not referenced....what happens to this lost value??