package com.javarush.task.task05.task0510;
/*
Кошкоинициация
*/
public class Cat {
private String name;
private int age;
private int weight;
private String address;
private String color;
// КОНСТ №1
public void initialize(String name){
this.name = name;
color = null;
age = 1;
weight = 2;
}
// КОНСТ №2
public void initialize(String name, int age, int weight){
this.name = name;
this.age = age;
this.weight = weight;
color = null;
address = null;
}
// КОНСТ №3
public void initialize(String name, int age){
this.name = name;
this.age = age;
weight = 2;
color = null;
address = null;
}
// КОНСТ №4
public void initialize(int weight, String color){
name = null;
age = 1;
address = null;
this.weight = weight;
this.color = color;
}
// КОНСТ №5
public void initialize(int weight, String color, String address){
this.weight = weight;
this.color = color;
this.address = address;
name = null;
age = 1;
}
public static void main(String[] args) {
}
}
package com.javarush.task.task05.task0510;
/*
Кошкоинициация
*/
public class Cat {
private String name;
private int age;
private int weight;
private String address;
private String color;
// КОНСТ №1
public void initialize(String name){
this.name = name;
color = null;
age = 1;
weight = 2;
}
// КОНСТ №2
public void initialize(String name, int age, int weight){
this.name = name;
this.age = age;
this.weight = weight;
color = null;
address = null;
}
// КОНСТ №3
public void initialize(String name, int age){
this.name = name;
this.age = age;
weight = 2;
color = null;
address = null;
}
// КОНСТ №4
public void initialize(int weight, String color){
name = null;
age = 1;
address = null;
this.weight = weight;
this.color = color;
}
// КОНСТ №5
public void initialize(int weight, String color, String address){
this.weight = weight;
this.color = color;
this.address = address;
name = null;
age = 1;
}
public static void main(String[] args) {
}
}