Below code fails to pass the verification. Hint says to have the NormalCat constructor without parameter. So I deleted and pass. But I don't know why I need that constructor because the code runs well without it.
public class Solution {
public static void main(String[] args) {
SiamCat coco = new SiamCat("Coco");
NakedCat nakedCoco = coco.shave();
}
public static class NakedCat {
}
public static class NormalCat extends NakedCat {
//public NormalCat() {}
public NormalCat(String name) {
System.out.println("My name is " + name);
}
public NakedCat shave() {
return this;
}
}
public static class SiamCat extends NormalCat {
public SiamCat(String name) {
super(name);
}
}
}