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