// Example use of a mollifying cast to retrieve an element from a non-generic collection. Dog d = (Dog) collection.get( "Fido" ); d.bark(); // Had you written this without the cast: Object d = collection.get( "Fido" ); d.bark(); // the compiler would have no idea what the method bark // meant. It could be a Dog.bark() or a Tree.bark(), but in // any case bark is not a method of Object. // Similarly if you use the contraction, the compiler knows which bark you meant. ( (Dog) collection.get( "Fido" ) ).bark();