Font size
WorksheetsGreenfoot Java Classes
Total questions: 12
Worksheet time: 6mins
The *; after import greenfoot does what?
Imports all the classes for the greenfoot coding package.
Tells greenfoot to allow code to be entered.
Limits the amount of code you can write.
Names the code Java.
Which one is a correctly coded comment?
/**
* Im a great comment
*/
/***
** Im a great comment.
*//
/
*Im a great comment.
*/
/**
Im a great comment.
*/
What are the yellow boxes?
functions
methods
variables
algorithms
What does public void turtle extend to?
the turtle world
turtle class
actor class
greenfoot
What sets different methods apart or the actor class?
[ ]
" "
{ }
( )
Which of the following is correctly coded?
public void act()
{
move(4);
}
public Void act():
{
move(4);
}
Public Void Act()
{
move(4);
}
public void act();
{
move(4)
}
Which method allows for you to use keyboard controls for an actor?
checkKeys();
CheckKeys();
checkkeys();
checkKey{};
What statement checks to see if checkKeys are down?
if ( Greenfoot.isKeyDown("left"))
if ( greenFoot.isKeyDown(left))
if ( Greenfoot.isKeyDown(left))
if ( Greenfoot.iskeydown("left))
Which are all the possible ways to write comments?
// comment
/*
/**
/*/
Why are some comments blue while others are light gray color?
The blue explains the code while the gray gives explanation to the programmer maintaining the coded program.
There is no difference or reason.
The gray are instructions for the code reader, while blue is just for the player.
Blue comments are for the programmer, the gray is for the teacher.
To make your turtle turn randomly around the world, what is the correct coded method?
randomTurn();
randomturn();
randomturn(4);
Randomturn();
What is the method to call the function to make another actor cause another actor to disappear?
tryToEatClass();
trytoEatClass();
TryToEatClass();
trytoeatclass();
