I want to make a doubly linked list Train where head is type of Locomotive and nodes are type of Wagon.
I thought about using templates, Train<T>, but I tried to use if(Train<T> cart instance of Locomotive) and failed, so that won't work...
Any ideas?
Make a LinkedList of type
TrainCaras a superclass or interface, and thenLocomotiveandWagoneither extend or implementTrainCar.