Hi all!
I have a question about generics.
I am trying to create a generic state machine.
so these are the classes:
The problem is with SampleChild1 class.
whenever I try to pass a SampleChild1State1 Object into the setState method of BaseClass I get the following error:
The method setState(State<capture#2-of ? extends BaseClass>) in the type StateMachine<capture#2-of ? extends BaseClass> is not applicable for the arguments (SampleChild1State1)
Is there anyway to solve this problem? to make my StateMachine class generic so I can declare it only in BaseClass?
Or I will have to have a new specific Object of StateMachine class in any subclass of Baseclass?
Thanks!