2

So, i have one stupid question, but i want to know the answer). I have a parameterized method:

public <E,T extends Enum<T> & ParametrizedCloneable<E>> E getE(Class<T> eClass){...}

And perhaps I want to have a list or annotation with classes which i can use in this method.

 List<? extends Enum & ParametrizedCloneable> - incorrect
 List<? extends Enum ,ParametrizedCloneable> - incorrect too

What the right way?

Yaroslav
  • 260
  • 1
  • 3
  • 13
  • I had never even heard of parameterized methods. But what does the `&` do? It extends boths interfaces? – wvdz Apr 21 '15 at 18:58
  • @popovitsj take a look at [this](http://stackoverflow.com/questions/745756/java-generics-wildcarding-with-multiple-classes) – Turing85 Apr 21 '15 at 18:59
  • Thx @Turing85, so my assumption was correct. Of course they can't use the comma for this, because it would be ambiguous. – wvdz Apr 21 '15 at 19:07

0 Answers0