Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-06-2008, 12:04 AM
Member
 
Join Date: Jul 2008
Posts: 1
anitha2324 is on a distinguished road
what is <....>
Hi All,

am newbie to java , i have read some code examples and i have found some declaration like this

Hashtable<String, String> properties = new Hashtable<String, String>();
or something like
private static HashMap<String,JMSSenderTest> jmsSenders = new HashMap<String,JMSSenderTest>();


i am not able to understand what is meaning of that especially about the <String,String>


so what does the symbol <....> indicates

sorry for the silly question
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-06-2008, 12:17 AM
Norm's Avatar
Senior Member
 
Join Date: Jun 2008
Location: SW MO, USA
Posts: 1,481
Norm is on a distinguished road
That syntax is part of the Generic coding for java. Go to the Sun's tutorial and read up.
Generics is a way of telling the compiler how you are going to use a class and have the compiler check that you use it correctly.
Many of the classes that use the Generic coding technique allow the use of Objects and are prone to problems with type casting and wrong types being used. Generics allows the compiler to check on the coder's use of a class.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 07-06-2008, 12:19 AM
Member
 
Join Date: Jul 2008
Posts: 26
Jeremy is on a distinguished road
Those brackets signify parametrized type definitions. If you want an ArrayList of Strings then you would define it as such:

Code:
ArrayList<String> list = new ArrayList<String>();
The code example you have is a map of key-value pairs where the keys are Strings and the values are JMSSenderTest.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 07-06-2008, 02:32 AM
Senior Member
 
Join Date: Jun 2008
Posts: 303
masijade is on a distinguished road
Generics
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +3. The time now is 03:22 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org