I have a superclass (Student) and two subclasses (RStudent and CStudent) that inherit from Student. I want to be able to have one ArrayList of both RStudent and CStudent. I tried just using ArrayList<Student> students = new Arraylist<>(); but I cant access any variables that are specific to the subclasses. For example if I use students.add(newCStudent), when I try use students.get(0).mark (which is a variable only in CStudent) it doesn't work. How can I do this?