posted 17 years ago
In both your cases, the objects you use are only known about in the method you show. As you say, in that case, they are legal but pointless examples.
For synchronisation, a plain Object would typically be used as a final or static final member of a class. That way, the one Object can be seen by several pieces of code that need to synchronise together.
For use of plain Object with a hash map, the Objects used as keys would be passed around the program as opaque handles. An example would be a factory method that creates some sort of useful object and puts it into a map for later retrieval. It might create a new Object as the key for the map, and return that object to the caller, so that the caller could later use it to request retrieval of the same map entry.
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.