|
-
July 30th, 2009, 06:48 PM
#10
Re: Linked List
@SuppressWarnings("unchecked") goes just before public void doLinkedListExample(), not when it is used.
Another way to avoid the warnings (without suppressing them) would be to declare the lists as List<Object> (to allow the addition of Integers and Strings to the same list), but then you would get an error with Collection.sort. If, instead of <Object> you use <String> (you'll also need to convert the integers to String) you'll have no problems with sort.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|