Jump to content

swimfan1137

New Members
  • Posts

    1
  • Joined

  • Last visited

Everything posted by swimfan1137

  1. I keep getting this error. Not sure how to fix it.. Please help me bash-3.00$ javac UpperRightTile.java UpperRightTile.java:48: enum types may not be instantiated Direction newDirection = new Direction(); public class UpperRightTile extends Tile { //Directions public static final Direction DOWN; public static final Direction UP; public static final Direction LEFT; public static final Direction RIGHT; /** * Default Constructor */ public UpperRightTile() { } /** * Determine the direction of the car after traveling through this tile * in the specified direction. * * @param currentDirrection the current direction of the car * @return the new direction of the car */ public Direction newDirection(Direction currentDirection){ Direction newDirection = new Direction(); newDirection = currentDirection; //New Direction if (newDirection == UP){ newDirection = LEFT; }else if (newDirection == LEFT){ newDirection = DOWN; }else if (newDirection == DOWN){ newDirection = RIGHT; }else{ newDirection = UP; } return newDirection; } /** * Retuns a string representation of this tile. * * @return a string representation of the tile. */ public String toString(){ return "1"; } } // UpperRightTile
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.