Проходит только предпоследний конструктор, хотя я особого его отличия не вижу. Если я правильно понял, то при отсутствующем значении, полям нужно задать "стандартные" значения. Для String это null, для int это по желанию. А вот инструкций к типу char я не вижу, кстати (решил поставить 0). Может, проблема в этом? Но почему тогда предпоследний конструктор (в порядке проверки) проходит?
package com.javarush.task.task05.task0517;
/*
Конструируем котиков
*/
public class Cat {
//напишите тут ваш код
String name, address, color;
int age, weight ;
char sex;
public Cat(String address, String color, int weight) {
this.address = address;
this.color = color;
this.weight = weight;
this.name = null;
this.age = 4;
this.sex = 0;
}
public Cat(int weight, String color) { //Одобрен только этот конструктор
this.weight = weight;
this.color = color;
this.sex = 0;
this.name = null;
this.age = 4;
}
public Cat(String name, int age) {
this.name = name;
this.age = age;
this.weight = 5;
this.color = null;
this.sex = 0;
}
public Cat(String name, int age, int weight) {
this.name = name;
this.age = age;
this.weight = weight;
this.color = null;
this.sex = 0;
}
public Cat(String name) {
this.name = name;
this.age = 4;
this.weight = 5;
this.color = null;
this.sex = 0;
}
public static void main(String[] args) {
}
}