I've just started with greenfoot and I'm following the tutorial. At one point it says to add:
But when I do it gives me a class, interface, or enum expected error. I don't see any out of place brackets, but I am new so I could be missing something.
And can someone explain what "public void" means? Thanks!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | /** * Turn in a random direction. */ public void turnRandom() { // get a random number between 0 and 3... int turns = Greenfoot.getRandomNumber( 4 ); // ...an turn left that many times. for ( int i= 0 ; i<turns; i++) { turnLeft(); } } |