B
Bruce Feist
I have a generic class ClassX defined with a parameterized type T of
subclass ClassY. Within a ClassX method, I want to allocate a new
object of type T. When I try using:
ClassY foo = new T();
I get a message telling me that:
Maze.java:25: unexpected type
found : type parameter T
required: class
How can I accomplish this?
Thanks,
Bruce Feist
subclass ClassY. Within a ClassX method, I want to allocate a new
object of type T. When I try using:
ClassY foo = new T();
I get a message telling me that:
Maze.java:25: unexpected type
found : type parameter T
required: class
How can I accomplish this?
Thanks,
Bruce Feist