Showing posts with label Collections. Show all posts
Showing posts with label Collections. Show all posts

Friday, 20 May 2016

when to use boolean and Boolean in java

when to use boolean and Boolean
1. if you want to have true or false use boolean.
2. if you want to have true or false or Null use boolean.

Ref : stackoverflow

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