Wrong Use of Generics

When we define generics, we use Object as a data type where we are not sure about the actual type.
Map<String, Object> data = new HashMap<String, Object>();
We are not doing any value add by defining the generic as Object (You must be remembering that Object class is the Super parent class).

People who read this post also read :



0 comments:

Post a Comment

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More