Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

ЛБ / auto

.java
Скачиваний:
47
Добавлен:
12.11.2016
Размер:
1.32 Кб
Скачать
public class auto
{
private String carname,color;
private int weight,speed;

public auto(String carname, String color, int weight, int speed)
{

this.carname=carname;
this.color=color;
this.weight=weight;
this.speed=speed;

}

public String getName()
{
return this.carname;
}
public int getSpeed()
{
return this.speed;
}
public int getWeight()
{
return this.weight;
}
public String getColor()
{
return this.color;
}

}

class trucks extends auto
{
private boolean heavy;
public trucks(String carname, String color, int weight, int speed,boolean heavy)
{
super( carname, color, weight, speed);
this.heavy=heavy;
}
public boolean carHeavy()
{
return this.heavy;
}

}

class bus extends auto
{
private boolean many_pass;
public bus(String carname, String color, int weight, int speed,boolean many_pass)
{
super( carname, color, weight, speed);
this.many_pass=many_pass;
}
public boolean many_pass()
{
return this.many_pass;
}
}

class sports extends auto
{
private boolean fast;
public sports(String carname, String color, int weight, int speed,boolean fast)
{
super(carname,color,weight,speed);
this.fast=fast;
}
public boolean carFast()
{
return this.fast;
}

}
Соседние файлы в папке ЛБ