New course! Every coder should learn Generative AI!
Try a free lesson+ 1
Something is very wrong here
So, after reviewing this here code I couldn't find out what my issue is. I'm completely stumped. I need it to output something BUT nothing is being printed nor are the classes properly printing out text when their methods. Anything helps. https://code.sololearn.com/cqmvV2zDkE8S/?ref=app
1 Answer
0
this way abstract Animal class get more sense
abstract class Animal
implements Swimmer, Player {
protected String species;
public void swim() {
System.out.println(
species +" is swimming");
}
public void play() {
System.out.println(
species +" is playing");
}
}
class Dog extends Animal {
Dog() { species = "Dog"; }
}
class Cat extends Animal {
Cat() { species = "Cat"; }
}