您如何定义类/接口 Adult、Student 和 Engineer,以便下一个序列仅在指定的地方给出编译错误?
class Test {
public static void main(String args[]) {
Adult a = new Student(); //without giving compilation error
Adult b = new Engineer();//without giving compilation error
a.explorare(); //without giving compilation error
b.explorare(); //without giving compilation error
a.afisare(); //without giving compilation error
b.afisare(); //compilation error