
Добавил:
nechitay03
Только когда поступишь в технический вуз поймешь на сколько ты гуманитарий
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:JAVA ДЛЯ ПОТОКОВ ИВБО / ПР-6 / Bike
.java package bikeproject;
public class Bike implements BikeManufacturer {
private String handleBars, frame, tyres, seatType;
private int NumGears;
public Bike() {
this.handleBars = "default";
this.frame = "default";
this.tyres = "default";
this.seatType = "default";
this.NumGears = 1;
}
public Bike(String handleBars, String frame, String tyres, String seatType, int numGears) {
this.handleBars = handleBars;
this.frame = frame;
this.tyres = tyres;
this.seatType = seatType;
this.NumGears = numGears;
}
@Override
public void printDescription() {
System.out.println("\n" + Make + "\n"
+ "This bike has " + this.handleBars + " handlebars on a "
+ this.frame + " frame with " + this.NumGears + " gears."
+ "\nIt has a " + this.seatType + " seat with " + this.tyres + " tyres.");
}
}
public class Bike implements BikeManufacturer {
private String handleBars, frame, tyres, seatType;
private int NumGears;
public Bike() {
this.handleBars = "default";
this.frame = "default";
this.tyres = "default";
this.seatType = "default";
this.NumGears = 1;
}
public Bike(String handleBars, String frame, String tyres, String seatType, int numGears) {
this.handleBars = handleBars;
this.frame = frame;
this.tyres = tyres;
this.seatType = seatType;
this.NumGears = numGears;
}
@Override
public void printDescription() {
System.out.println("\n" + Make + "\n"
+ "This bike has " + this.handleBars + " handlebars on a "
+ this.frame + " frame with " + this.NumGears + " gears."
+ "\nIt has a " + this.seatType + " seat with " + this.tyres + " tyres.");
}
}
Соседние файлы в папке ПР-6