posted 17 years ago
When you write the push method as:
public <E> void push(E input)
you are redefining the E type. This E can be a totally different E than the one you used when defining your class. You are actually hiding the type E with the type parameter E (just like an parameter can hide and instance variable)
If you define the method as:
public <F> void push(F input)
you will get the message "cannot convert from F to E", which is more clear...