aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes non-generic collection always compiles with warning ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "non-generic collection always compiles with warning ?" Watch "non-generic collection always compiles with warning ?" New topic
Author

non-generic collection always compiles with warning ?

vikram choudhary .
Greenhorn

Joined: Apr 25, 2007
Posts: 7
non-generic collection always compiles with warning ?
is it correct?
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729



It depends on how you use the non-generic collection.
[ April 30, 2007: Message edited by: Barry Gaunt ]

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Param Yalamanchili
Greenhorn

Joined: Apr 25, 2007
Posts: 8
This code wont generate any warnings

public class Wonder
{
public static void main(String[] args)
{
List l = new ArrayList(); // no warning
List<String> ls = new ArrayList<String>(); //NO warning
}
}
[ April 30, 2007: Message edited by: Param Yalamanchili ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: non-generic collection always compiles with warning ?