Calling a subclass method
Hello, I'm a beginner with Java. I have a super class named Student & two subclasses, undergraduate & graduate. I'm trying to call a method from one of those subclasses, but it will only let me call the Student methods and not the subclass methods. I have an array of Students in a seperate class with this code.if(class_room[current_index]instanceof Undergraduate_Student)
{
jTextField4.setText(class_room[current_index].getHighSchool());
}
Undergraduate_Student class has a getHighSchool method, and Graduate Student has a getCollege method.Can I do it this way, or do I have to put the method in the superclass in order for it to work?

