class Enum is defined in API as:
public abstract class Enum<E extends Enum<E>>
I have
enum Cards { Trefs(2.3), Clubs(1.0);
public double d;
private Cards(double val) {
this.d = val;
}
}
Question 1:
Enum e = Cards.Clubs; //compiles, but with warning: "References to generic type Enum<E> should be parameterized"
Enum<???what-shall-I-write-here??> e1 = Cards.Clubs; //Question 1
Question 2:
this compiles:
Map<Enum, Integer> map0 = new HashMap<Enum, Integer>();
Map<Enum, Integer> map1 = new HashMap<Enum, Integer>();
map1.put(Cards.Clubs, new Integer(54));
Map<Enum, Integer> map2 = new EnumMap<>(map1);
But can I add anything in angle brackets of RHS (new EnumMap), like I did for map1 above?
Map<Enum, Integer> map2 = new EnumMap<???what-can-I-write-here??>(map1);
P.S. I researched SO, but found nothing DIRECTLY answering above question. My research: