File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Generics :Why type variables are not bound Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Generics :Why type variables are not bound " Watch "Generics :Why type variables are not bound " New topic
Author

Generics :Why type variables are not bound

Kartik Patel
Ranch Hand

Joined: Sep 12, 2005
Posts: 73
Can anyone please let me know why Type variables are not bound?

Can't I write List<Number extends Comparable>?

How can I make sure that only List of Numbers which extends comparable should be residing in particular list?


Chop your own wood, and it will warm you twice. - Henry Ford
Nicholas Jordan
Ranch Hand

Joined: Sep 17, 2006
Posts: 1282
What do you mean by bound?

Read:

http://java.sun.com/docs/books/tutorial/collections/interfaces/order.html

and see if that helps
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Generics :Why type variables are not bound
 
Similar Threads
Problem with generics and LinkedList
I don't see an advantage of Generics of Java 5 here!
Generics, multiple bounding types and efficiency
Generics doubt...
Good Reference on Generics