你们作业有用到讲的那个知识点嘛,我的几乎没有。。。
package homework;
public class Father {
String transport;//运输工具
String method;//运输方式
String peopleNum;//运输人数
public void setFather(String transport,String method,String peopleNum) {
this.transport = transport;
this.method = method;
this.peopleNum = peopleNum;
System.out.println(transport+"通过"+method+"运输"+peopleNum);
}
}
public class Eg extends Father {
public static void main(String[] args) {
Father fa = new Father();
fa.setFather("汽车", "陆地", "30人");
fa.setFather("轮船", "海上", "150人");
fa.setFather("飞机", "天空", "200人");
}
}