Something is wrong with this code. Can someone help?
Hi GUYS. TODAY I CREATED A CODE USING JAVA. I STARTED THE JAVA COURSE JUST 3 DAYS AGO. I MADE MY FIRST CODE AND THIS WAS GOING TO BE MY SECOND CODE. BUT UNFORTUNATELY, I GOT 26 ERRORS!!! I RALLY WANT TO FIX THIS THE IDEA JUST SEEMES SO GREAT. CAN SOMEONE PLEASE HELP. HERE IS THE CODE: public class Ninja { void attack(){ System.out.println("Attack!"); } void defend(){ System.out.println("Enemy is attacking. Initiate all shields!"); } void win(){ System.out.println("We won"); } void lose(){ System.out.println("We lost"); } } public class Enemy{ void attack(){ System.out.println("Enemy is attacking us"); } void retreat(){ System.out.println("Enemy is retreating!"); } void defend(){ System.out.println("Enemy is blocking our attack"); } } public static void main(String[] args) { Ninja ninja = new Ninja(); Enemy enemy = new Enemy(); int x = 2; switch(x){ case 1: ninja.attack(); enemy.defend(); ninja.attack(); ninja.win(); break; case 2: enemy.attack(); ninja.defend(); ninja.lose(); break; case 3: ninja.attack(); ninja.attack(); enemy.defend(); enemy.retreat(); ninja.win(); break; case 4: enemy.attack(); ninja.defend(); enemy.attack(); ninja.lose(); break; case 5: ninja.attack(); enemy.defend(); enemy.defend(); ninja.attack(); enemy.retreat(); ninja.win(); break; } } } I WOULD REALLY APPRICIATE IF YOU HELPED. THANKS 😊