I am new to Java. I have this code to process the following requests. I have a compile error and I am confused on how to correctly format the code. Please review the code and give me some help.
An Athlete needs to be instantiated at (1, 1) facing north with an infinite number of beepers. A class method followWallsRight needs to be written that contains the code to escape the maze. ================================================== ============
import edu.fcps.karel2.Display; import edu.fcps.karel2.Robot; public class Lab10 { public static void followWallsRight(Athlete king); public static void main(String[] args) { Display.openWorld("maps/maze1.map"); Display.setSize(10, 10); Display.setSpeed(10); } Athlete king = new Athlete(1, 1, Display.NORTH, Display.INFINITY); { while(king.frontIsClear()) king.move(); if(!king.rightIsClear()) king.move(); } }
Error message:
Lab10.java:6: error: missing method body, or declare abstract
public static void followWallsRight(Athlete king);