Thursday 19 May 2016

Generic Maps in Collections


Generic Maps in Collections
IF we want to restrict the type of object we can go for Generic Map using Map<key,value> pair

Map<String, Object> map = new HashMap<String, Object>();
In the above example the map object will accept key of type string and value of type Object

No comments:

Post a Comment