public class car {
public void methods(){
int num=60;
System.out.println("汽车可以在陆地上运输"+num+"名游客;");
}
}
public class plane extends car {
public void mothods(){
int num=300;
System.out.println("飞机可以在空中运输"+num+"名游客;");
}
}
public class ship extends plane {
public void methods(){
int num=200;
System.out.println("轮船可以在海上运输"+num+"名游客;");
}
}
public class Result {
public static void main(String[] args) {
// TODO Auto-generated method stub
car one1=new car();
car one2=new ship();
car one3=new plane();
one1.methods();
one2.methods();
one3.methods();
}
}