Выдает ошибку только в последнем пункте: У класса должен быть метод initialize, принимающий в качестве параметров вес, цвет, адрес и инициализирующий все переменные класса, кроме имени.
Хотя как по мне должно быть все правильно...
public class Cat {
//напишите тут ваш код
String name = null;
int weight;
int age;
String color;
String address = null;
public void initialize(String name){
this.name = name;
this.weight = 2;
this.age = 10;
this.color = "black";
}
public void initialize(String name, int weight, int age){
this.name = name;
this.weight = weight;
this.age = age;
this.color = "black";
}
public void initialize(String name, int age){
this.name = name;
this.age = age;
this.weight = 2;
this.color = "black";
}
public void initialize(int weight, String color){
this.weight = weight;
this.color = color;
this.age = 10;
}
public void initialize(int weight, String color, String adress){
this.weight = weight;
this.color = color;
this.address = address;
this.age = 10;
}
public static void main(String[] args) {
}
}
Светлана
27 уровень
Подскажите что не так???
Решен
Комментарии (2)
- популярные
- новые
- старые
Для того, чтобы оставить комментарий Вы должны авторизоваться
Светлана
23 ноября 2018, 19:22
Ааааа точно!) Спасибо большое!)
0
Alex MExpert
23 ноября 2018, 01:54
address - одну букву d пропустила
0