• Post Reply Bookmark Topic Watch Topic
  • New Topic

What is this? <String, Object>  RSS feed

 
Terry Jeske
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have been looking at some sample code for a Spring app, and I noticed the following type of object instatiation:

I have not seen this before -is it new for JDK 1.5? My guess is that it is setting up the HashMap to handle String, Object value pairs. Is this done for performance? Can someone point me to a link where I can read up on this?

Thx.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Terry,

Yes, it's the new "Generics" feature in 1.5. It's not for performance: it's for type safety, leading to cleaner and more robust code. Here is a quickie introduction.
 
Detlev Beutner
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Terry,

I have not seen this before -is it new for JDK 1.5?


Yes.

My guess is that it is setting up the HashMap to handle String, Object value pairs.


Rrrighty :-)

Is this done for performance?


No, for type-safetyness as well as for the convenience of the developer.

Can someone point me to a link where I can read up on this?


See this info for some examples.

Hope it helps
Detlev
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!