0

For example I have a List: forumData.

List<HashMap<String, String>> forumData = new ArrayList<HashMap<String, String>>();

I now have to write 3 lines to insert the data as follows:

HashMap<String, String> _forum = new HashMap<String, String>();
_forum.put("ASDF", "ASDF");
forumData.add(_forum);

Can I do something like below?

forumData.add(new HashMap<String, String>("ASDF,"ASDF"));

?

Abby Chau Yu Hoi
  • 1,378
  • 3
  • 15
  • 37
  • 1
    What do you mean lazy? As that usually implies late evaluation. – weston Oct 11 '14 at 09:08
  • 1
    "Lazy initialization" has nothing to do with the programmer being lazy to write code, it is an initialization that is delayed to the moment the data is actually required. – Joffrey Oct 11 '14 at 09:18

0 Answers0