Задача не проходит валидацию с комментарием:
У класса должен быть метод initialize, принимающий в качестве параметров имя, возраст и инициализирующий все переменные класса, кроме адреса.
Убедись, что в классе есть метод initialize, принимающий String и int в качестве параметра.
Третий метод initialize содержит переменные String name, int age. Инициализирует name, age, color, weight.
Не могу понять что не нравится.
package com.javarush.task.task05.task0510;
/*
Кошкоинициация
*/
public class Cat {
String name = null;
int age;
int weight;
String address = null;
String color;
public void initialize(String name) {
this.name = name;
this.age = 3;
this.weight = 7;
this.color = "grey";
}
public void initialize(String name, int weight, int age) {
this.name = name;
this.age = age;
this.weight = weight;
this.color = "grey";
}
public void initiialize(String name, int age) {
this.name = name;
this.age = age;
this.weight = 7;
this.color = "grey";
}
public void initialize(int weight, String color) {
this.weight=weight;
this.color=color;
this.age=3;
}
public void initialize(int weight, String color, String address) {
this.weight=weight;
this.color=color;
this.address=address;
this.age=3;
}
//напишите тут ваш код
public static void main(String[] args) {
}
}