OP said that we would have to use reflection to make this work in Java, but I think we can also make use of Generic classes: class Pokemon<T extends PokeType> { public T type; public Pokemon(T givenType) { type =…
OP said that we would have to use reflection to make this work in Java, but I think we can also make use of Generic classes: class Pokemon<T extends PokeType> { public T type; public Pokemon(T givenType) { type =…