Что это за магия такая?
package com.javarush.task.task05.task0510;
/*
Кошкоинициация
*/
public class Cat {
String name;
int age;
int weight;
String address;
String color;
public void initialize(String name) {
name = "Red";
this.name=name;
this.age=5;
this.weight=10;
this.color="multicolor";
}
public void initialize(String name, int weight, int age) {
this.name="White";
this.weight=8;
this.age=6;
this.color="some";
}
public void initialize(String name, int age) {
name="Black";
this.name=name;
age=7;
this.age=age;
this.weight=10;
this.color = "some";
}
public void initialize(int weight, String color) {
weight=5;
this.weight=weight;
color="Unknown";
this.color=color;
this.age=4;
}
public void initialize(int weight, String color, String address) {
weight=8;
this.weight=weight;
color="Beauty";
this.color=color;
address="Russia";
this.address=address;
this.age=7;
}
public static void main (String[] args) {
}
}