wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Greenfoot Java Classes

Total questions: 12

Worksheet time: 6mins

Name
Class
Date
1.

The *; after import greenfoot does what?

a)

Imports all the classes for the greenfoot coding package.

b)

Tells greenfoot to allow code to be entered.

c)

Limits the amount of code you can write.

d)

Names the code Java.

2.

Which one is a correctly coded comment?

a)

/**

* Im a great comment

*/

b)

/***

** Im a great comment.

*//

c)

/

*Im a great comment.

*/

d)

/**

Im a great comment.

*/

3.

What are the yellow boxes?

a)

functions

b)

methods

c)

variables

d)

algorithms

4.

What does public void turtle extend to?

a)

the turtle world

b)

turtle class

c)

actor class

d)

greenfoot

5.

What sets different methods apart or the actor class?

a)

[ ]

b)

" "

c)

{ }

d)

( )

6.

Which of the following is correctly coded?

a)

public void act()

{

move(4);

}

b)

public Void act():

{

move(4);

}

c)

Public Void Act()

{

move(4);

}

d)

public void act();

{

move(4)

}

7.

Which method allows for you to use keyboard controls for an actor?

a)

checkKeys();

b)

CheckKeys();

c)

checkkeys();

d)

checkKey{};

8.

What statement checks to see if checkKeys are down?

a)

if ( Greenfoot.isKeyDown("left"))

b)

if ( greenFoot.isKeyDown(left))

c)

if ( Greenfoot.isKeyDown(left))

d)

if ( Greenfoot.iskeydown("left))

9.

Which are all the possible ways to write comments?

a)

// comment

b)

/*

c)

/**

d)

/*/

10.

Why are some comments blue while others are light gray color?

a)

The blue explains the code while the gray gives explanation to the programmer maintaining the coded program.

b)

There is no difference or reason.

c)

The gray are instructions for the code reader, while blue is just for the player.

d)

Blue comments are for the programmer, the gray is for the teacher.

11.

To make your turtle turn randomly around the world, what is the correct coded method?

a)

randomTurn();

b)

randomturn();

c)

randomturn(4);

d)

Randomturn();

12.

What is the method to call the function to make another actor cause another actor to disappear?

a)

tryToEatClass();

b)

trytoEatClass();

c)

TryToEatClass();

d)

trytoeatclass();