Все правильно по коду, но не проходит задача пункт "У класса должен быть метод initialize, принимающий в качестве параметра имя, но инициализирующий все переменные класса, кроме адреса". В чем тут ошибка?
package com.javarush.task.task05.task0510;
/*
Кошкоинициация
*/
public class Cat
{
public String name;
public int weight;
public int age;
public String color;
public String address;
public void initialize(String name) {
this.name = name;
this.weight = 3;
this.age = 1;
this.color = "color";
}
public void initialize(String name, int weight, int age){
this.name = name;
this.weight = weight;
this.age = age;
this.color = "blue";
}
public void initialize(String name, int age){
this.name = name;
this.age = age;
this.color = "blue";
this.weight = 3;
}
public void initialize(int weight, String color){
this.color = color;
this.weight = weight;
this.age = 2;
}
public void initialize(int weight, String color, String address){
this.weight = weight;
this.color = color;
this.address = address;
this.age = 2;
}
public static void main(String ... args) {
}
}