日期:2014-05-20 浏览次数:20603 次
class Car {
private String name;
private String color;
public Car(String name, String color) {
//这里你自己写
}
public void setName(String name) {
//这里你自己写
}
public String getName() {
//这里你自己写
}
public void setColor(String color) {
//这里你自己写
}
public String getColor() {
//这里你自己写
}
public String getMessage() {
//这里你自己写
}
}
class Trunk extends Car {
public Trunk(String name, String color) {
//这里你自己写
}
}
public class test8 {
public static void main(String[] args) {
Car car = new Car("马", "红");
System.out.println(car.getMessage());
Trunk trunk = new Trunk("大", "绿");
System.out.println(trunk.getMessage());
}
}