|
|
|
|
|
by tsimionescu
1414 days ago
|
|
How would you define object identity if different objects can have the same value and the same address? To my mind, an object is a value with a unique identity. How else would you define it? And if you want a billion empty values, then yes, those could all be implemented by the same object - it's pretty easy to implement, even though it would be ncie for a compiler to do it automatically (like how Java normally gives you the same Integer object if you box the same int value in two different places, even though it will give you a different Integer of the same value if you explicitly ask for it with new). |
|