I have the following classes
class Person {
private String name;
void getName(){...}}
class Student extends Person{
String class;
void getCl
Why don't you just write an empty method in Person and override it in the children classes? And call it, when it needs to be:
void caluculate(Person p){
p.dotheCalculate();
}
This would mean you have to have the same method in both children classes, but i don't see why this would be a problem at all.