Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Illegal Start of Type Compile-Time Error

$
0
0
I'm getting the most confounding error. The first command prompt error (caught by holding the scroll bar in the middle of compiling) reads

Quote

SaveChristmas.java:27026: error: illegal start of expression
public void moveUp()


The carrot's pointing to the 'p'. I have no idea why this is happening, as this is the first time I've ever had a keyword pointed out as the error. I already checked for parenthesis in the code immediately above it. There are no other methods with the same name. The word void is also being called out, and moveUp is being called out for semi-colons. Every method after this is also being called out in the same exact way.

Here's the surrounding code, starting at line 26963:
        else if (initialLocation.contains("b"))
        {
            if (initialLocation.contains("1"))
            {
                currentLocation = "c1";
            }
            else if (initialLocation.contains("2"))
            {
                currentLocation = "c2";
            }
            else if (initialLocation.contains("3"))
            {
                currentLocation = "c3";
            }
            else if (initialLocation.contains("4"))
            {
                currentLocation = "c4";
            }
            else if (initialLocation.contains("5"))
            {
                currentLocation = "c5";
            }
            else if (initialLocation.contains("6"))
            {
                currentLocation = "c6";
            }
            else if (initialLocation.contains("7"))
            {
                currentLocation = "c7";
            }
        }
        else if (initialLocation.contains("a"))
        {
            if (initialLocation.contains("1"))
            {
                currentLocation = "b1";
            }
            else if (initialLocation.contains("2"))
            {
                currentLocation = "b2";
            }
            else if (initialLocation.contains("3"))
            {
                currentLocation = "b3";
            }
            else if (initialLocation.contains("4"))
            {
                currentLocation = "b4";
            }
            else if (initialLocation.contains("5"))
            {
                currentLocation = "b5";
            }
            else if (initialLocation.contains("6"))
            {
                currentLocation = "b6";
            }
            else if (initialLocation.contains("7"))
            {
                currentLocation = "b7";
            }
        }
    }
    public void moveUp()
    {
        upString();
        if (largeLocation.equals(initialLargeLocation))
        {
            paintMovement();
            monsterMove();
            y++;
        }
        else
        {
            paintLargeMovement();
            objectRandomization();
            largeY++;
            initialLargeLocation = largeLocation;
        }
        bearAppear();
        initialLocation = currentLocation;
        
        if (currentLocation.equals(monsterALocation) || currentLocation.equals(monsterBLocation) || currentLocation.equals(monsterCLocation))
        {
            showStatus("You are attacked by a walrus!");
        }
    }

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>