Now the compiler can enforce String keys and MyClass objects. If you try to put anything else in you'll get compile time errors. And you won't have to cast MyClass objects when you take them out. It's pretty slick.
I have only scratched the surface on Generics myself with minimal syntax to avoid warnings and enforce some basic rules. There is much more to it. Google for "Java generics tutorial" or "faq" and see what's out there. Some of the better experts will likely chime in with their favorite resources for learning more.