-3

Possible Duplicate:
Java Generics - What is this syntax for?
In Java What is the < > notation

sBooksProjectionMap = new HashMap<String, String>();

Could anyone explain to me the meaning of this part of of above code:

new HashMap<String, String>()

I'm a newbie for Java and the <Sting, String> part is confusing me.

Community
  • 1
  • 1
mana
  • 1,075
  • 1
  • 24
  • 43

1 Answers1

1

Simply-

Map< key, value > map = new HashMap< key, value >();

example would be

Map<String,String> map = new HashMap<String,String>();
map.put("str","abcd");
map.put("str1","dcba");

Now getting them simply

map.get("str");  // abcd
map.get("str1"); // dcba
Subhrajyoti Majumder
  • 40,646
  • 13
  • 77
  • 103