Java Intermediate course problem | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
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?

2nd Oct 2023, 8:43 PM
David
David - avatar
3 ответов
+ 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.
2nd Oct 2023, 8:54 PM
A͢J
A͢J - avatar
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");    }    } }
4th Oct 2023, 2:16 PM
David
David - avatar
0
here it is but i can not procced next
4th Oct 2023, 2:17 PM
David
David - avatar