I'm just not sure if I got right...
if I write add method that look like this :
add (<? extends E> e)
each element in my collection could be from a different type (all of them extends E type (or from E itself)). right?
now if I write remove method that looks like this :
remove(Collection<?>) it won't be accept my collection because this is requires that all the elements in the given collection will be from the same type. am I right?
will this be acceptable instead?
remove(Collection<? extends E>)
Refer the Book SCJP by Kathy Sierra in chaper 7 page no 618 to 622.
I suggest you also check out the oracle tutorials.
Lesson: Generics (The Java™ Tutorials > Learning the Java Language)
As far as I know, however; remove(Collection<?>) will remove the collection, where ? is the type in the collection. Since you can load a collection with any type that extends E, removing a collection works fine as remove(Collection<?>).
I am, however; not especially experienced with generics. The tutorials will definitely provide you with a lot of useful information, and examples to illustrate everything.