С большой долей вероятностью метод initialize все же инициализирует переменные класса переданными значениями, но как Убедиться?
package com.javarush.task.task05.task0510;
/*
Кошкоинициация
*/
public class Cat {
//напишите тут ваш код
private String name;
private int age;
private int weight;
private String address;
private String color;
public void initialize(String name) {
this.name = name;
this.age = 7;
this.weight = 5;
this.color = "white";
}
public void initialize(String name, int weight, int age) {
this.name = "Barsik";
this.weight = 5;
this.age = 7;
this.color = "white";
}
public void initialize(String name, int age) {
this.name = name;
this.age = 7;
this.weight = 5;
this.color = "black";
}
public void initialize(int weight, String color) {
this.age = 8;
this.weight = 5;
this.color = "black";
}
public void initialize(int weight, String color, String address) {
this.age = 4;
this.weight = 2;
this.color = "white";
this.address = address;
}
public static void main(String[] args) {
}
}