/*
函数重载的特性:
1、在同一个类中
2、至少2个函数的函数名相同
3、函数的参数序列不同
*//*【练习题】08.构造方法的重载:  定义一个名为Vehicles(交通工具)的基类,
该类中应包含String类型的成员属性brand(商标)和color(颜色),
还应包含成员方法run(行驶,在控制台显示“我已经开动了”)和showInfo(显示信息,在控制台显示商标和颜色),
并编写构造方法初始化其成员属性。  编写Car(小汽车)类继承于Vehicles类,增加int型成员属性seats(座位),
还应增加成员方法showCar(在控制台显示小汽车的信息),并编写构造方法。 编写Truck(卡车)类继承于Vehicles类,增加float型成员属性load(载重),
还应增加成员方法showTruck(在控制台显示卡车的信息),并编写构造方法。 在main方法中测试以上各类。
*/class Vehicles {
String brand;
String color;

Vehicles(String b, String c){
brand = b;
color = c;
}
Vehicles(){
this("奔驰", "红色");
}
void run(){
System.out.println("我已经开动");
}

void showInfo(){
System.out.println("我的商标是:" + brand + " 我的颜色是:" + color);
}
}class Car extends Vehicles{
int  seats;
Car(String b, String c, int s){
super(b,c);
seats = s;
}
Car(){
this("奔驰","红色",5);
}
void showCar(){
super.showInfo();
System.out.println("我有" + seats +"个座位");
}
}class Track extends Vehicles{
float load;

Track(String b, String c, float l){
super(b, c);
load = l;
}
Track(){
this("xxxxx", "黄色", 35);
}
void showCar(){
super.showInfo();
System.out.println("我的重量是:" + load + "吨");
}
}重载构造函数