And you can use a form of wildcard notation in a class definition, to specify a range (called "bounds") for the type that can be used for the type parameter:
SCJP/OCPJP 6 | SCWCD/OCPJWCD 5 | OCMJEA in progress...
The future belongs to those who believe in the beauty of their dreams.Dream BIG!
------------------------
Bob
SCJP - 86% - June 11, 2009
Originally posted by Nabila Mohammad:
From what i figured from your post was that,
(Collection<? extends Base> c, Collection<? extends Number> c2)
Means you can add anything extending base and anything extending Number
But when you talk about
Collection<T> c, Collection<T> c2)
You can add anything , but both of them should be same..
They both should be Numbers or Integers - they cant be Number and Integer...
Am I right?
SCJP/OCPJP 6 | SCWCD/OCPJWCD 5 | OCMJEA in progress...