Добавил:
nyan
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Александр Б. / Основы Java / lab2_java / src / lab2_java / Radio
.java package lab2_java;
public class Radio {
private String station;
private boolean online;
Radio(){
station = "default";
online = false;
}
Radio(String station){
this.online = false;
this.station = station;
}
Radio(boolean online, String station){
this.online = online;
this.station = station;
}
void PlayTunes() {
this.online = true;
}
void ChangeStation(String station) {
this.station = station;
}
String getStation() {
return this.station;
}
boolean getStatus() {
return this.online;
}
String toStr(){
String bool;
bool = this.online ? "On" : "Off";
return "\nКанал: " + this.station + " Статус: " + bool + " ";
}
}
public class Radio {
private String station;
private boolean online;
Radio(){
station = "default";
online = false;
}
Radio(String station){
this.online = false;
this.station = station;
}
Radio(boolean online, String station){
this.online = online;
this.station = station;
}
void PlayTunes() {
this.online = true;
}
void ChangeStation(String station) {
this.station = station;
}
String getStation() {
return this.station;
}
boolean getStatus() {
return this.online;
}
String toStr(){
String bool;
bool = this.online ? "On" : "Off";
return "\nКанал: " + this.station + " Статус: " + bool + " ";
}
}