Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

unchecked call to add element

807600Dec 5 2007 — edited Dec 5 2007
I get the following warning:
warning: [unchecked] unchecked call to addElement(E) as a member of the raw type java.util.Vector

from the line:
((Vector)results.get( "ALL" )).addElement( new Result( date, home, hg, ag, away ) ) ;
I have had no problems fixing this warning with simple lines like:
private Hashtable<String,Object> results = new Hashtable<String,Object>() ;
but as you can see it is a bit more tricky.

The compiler highlights:
( new Result( date, home, hg, ag, away ) ) ;
as the warning. The Result Object takes parameters <String,String,Integer,Integer,String> if that helps.

Can anyone suggest how to fix this warning please?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 2 2008
Added on Dec 5 2007
3 comments
230 views