Hi, I have I am trying to create a program for my lecturer, who has asked me to create an application containing a number of different class that all inherit from an abstract class.
This has been completed and encapsulated, however in writting the application that utilises these classes I have run into an issue.
The application will carry out the same routines regardless of the users choice of class. However as each class has different methods I can not see how to cast between a public object to the chosen cast.
ie the user selects one of the classes to use
the user may select class B however the app would carry out the same procedures.
thinking i could just cast between the public object and an instance of the required class I tryed
public object userChoice;
B chosenClass = new B();
userChoice<B> = chosenClass;
this will not compile, please can anyone point me in the correct direction.