Jak to zrobić? Pierwszy podpunkt chce żeby tekst nie był wyświetlony a ostatni ma wyświetlać. Jak mam to rozumieć? Podobnie w podpunkcie gdzie Whale ma nic nie wyświetlać, przecież nie wyświetla.
package pl.codegym.task.task12.task1202;
/*
Wieloryby, potomkowie krów
*/
public class Solution {
public static void main(String[] args) {
Cow cow = new Whale();
System.out.println(cow.getName());
}
public static class Cow {
public String getName() {
return "Jestem krową";
}
}
public static class Whale extends Cow {
public String getName() {
return "Jestem wielorybem";
}
}
}