0
Java Intermediate course problem
I finished code problem in java intermediate module, lesson interfaces, but it is not working in SoloLearn. In NetBeans it works perfectly and on AI everything is fine. Test Case is locked. So how it is possible for me to continue my course is it some problem with platform or?
3 Réponses
+ 4
I think you are printing unnecessary text which should be, you should only print value.
Please share your code so we can tell exact issue.
0
class Main {
public static void main(String[] args) {
Animal dog = new Dog();
Animal cat = new Cat();
dog.swim();
dog.play();
cat.swim();
cat.play();
}
}
interface Swimmer {
void swim();
}
interface Player {
void play();
}
//implement the Swimmer and the Player interfaces
abstract class Animal implements Swimmer, Player{
}
class Dog extends Animal {
@Override
public void swim(){
System.out.println("Dog is swimming");
}
public void play(){
System.out.println("Dog is playing");
}
}
class Cat extends Animal {
//Override the swim() and the play() methods
@Override
public void swim(){
System.out.println("Cat is swimming");
}
public void play(){
System.out.println("Cat is playing");
}
}
}
0
here it is but i can not procced next