What's my code wrong?
Verify said "Be sure that the constructor initializes the required variables to the correct values.
Be sure that the constructor initializes the required variables to the correct values.
Be sure that the constructor initializes the required variables to the correct values."
Thanks a lot !
package com.codegym.task.task05.task0517;
/*
Creating cats
*/
public class Cat {
String name; String color; String address;
int age; int weight;
public Cat (String name){
this.name= name;
}
public Cat (String name, int weight, int age) {
this.name= name;
this.weight= weight;
this.age= age;
}
public Cat ( String name, int age) {
this.name= name;
this.age= age;
}
public Cat (int weight, String color) {
this.weight= weight;
this.color= color;
}
public Cat ( int weight, String color, String address) {
this.weight= weight;
this.color=color;
this.address= address;
}
public int getWeight() {
return weight;
}
public void setWeight( int weight) {
if (weight>0)
this.weight= weight;
else
System.out.println( " no");
}
public int getAge() {
return age;
}
public void setAge(int age){
if (age>=0)
this.age= age;
else
System.out.println("no");
}
public String getColor() {
return color;
}
public String getName() {
return name;
}
public String getAddress() {
return address;
}
//write your code here
public static void main(String[] args) {
}
}