From what I understand, this object does not make sense and does not contain real data (except, perhaps, its hash code)
The object carries its identity and its monitor . That's why this assignment is used to create object monitors that are separate from the object itself.
Why use this? Is this an acceptable practice?
The only thing I saw for this was to use the object as a monitor for other objects.
If I can do this, can I explicitly extend the class of the object?
That's right. You can extend an object in an anonymous class, for example:
Object obj = new Object() { @Override public String toString() { return "Hello, world!"; } };
source share