This site requires JavaScript, please enable it in your browser!
Greenfoot back
musashisamurai
musashisamurai wrote ...

2011/5/22

Compiling Error

musashisamurai musashisamurai

2011/5/22

#
Hello, Im new to Greenfoot, although I once did some java ages ago. Anyways, Im on the wombatworld scenario, and everytime I change something and compile it, it says "class, enum or interface expected" However, it says this fopr what as already there unchanged. Here is the code that keeps reading error messaages /** /** * Do whatever the wombat likes to to just now. */ public void act() } /** * Check whether there is a leaf in the same cell as we are. */ public boolean foundLeaf() { Does anyone know whats wrong
davmac davmac

2011/5/23

#
Your act() method has no opening brace for its method body. Where it says: public void act() } It should say:
    public void act()
    {
        // empty method!
    }
Your code is missing the '{'.
musashisamurai musashisamurai

2011/5/23

#
thank you, now it doesn't say the error for the top code. Do u have any advice on the bottom part, the Boolean/logic test? I checked that for the right bracket, and its correct, so I have no idea. THanks again though
davmac davmac

2011/5/23

#
Can you post the code?
You need to login to post a reply.