Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Java Hashtable Warning
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Martin




PostPosted: Fri Jul 22, 2005 10:09 am   Post subject: Java Hashtable Warning

I'm constructing a hashtable as follows:

code:
Hashtable <String, Proc> procedures = new Hashtable();


It warns me:
code:
parser.java:360: warning: [unchecked] unchecked conversion
found   : java.util.Hashtable
required: java.util.Hashtable<java.lang.String,CUP$parser$actions.Proc>
Hashtable <String, Proc> functions = new Hashtable();
                                     ^
1 warning


Help please. Smile
Sponsor
Sponsor
Sponsor
sponsor
rizzix




PostPosted: Fri Jul 22, 2005 6:18 pm   Post subject: (No subject)

by assigning it
Java:
new Hashtable();
you are infact assigning it
Java:
new Hashtable<Object, Object>();
instead, it should be more specific:
Java:
new Hashtable<String, Proc>();
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: