Вообще не понимаю в чем может быть проблема, вроде правильно( пробовал и так и сяк, разницы никакой) может баг какой-нибудь?
package com.javarush.task.task05.task0510;
/*
Кошкоинициация
*/
public class Cat {
String name = null;
int age = 5;
int weight = 4;
String address = null;
String color = "Orange";
public void nameS(String name) {
this.name = name;
this.age = age;
this.weight = weight;
this.color = color;
}
public void nameWeightAge(String name,int weight,int age) {
this.name = name;
this.weight = weight;
this.age = age;
this.color = color;
}
public void nameAge(String name, int age) {
this.name = name;
this.age = age;
this.weight = weight;
this.color = color;
}
public void weightColor(int weight, String color) {
this.weight = weight;
this.color = color;
this.age = age;
}
public void weightColorAddress(int weight, String color, String address) {
this.weight = weight;
this.color = color;
this.address = address;
this.age = age;
}
}