Quiz 3-1 Java Fundamental
Quiz 3-1 Java Fundamental
Quiz 3-1 Java Fundamental
An
object Mark for Review
is an (1) Points
instance
of a
class.
True or
false?
True (*)
False
Correct
2. In Greenfoot to create a new instance of a class, you right-click on the class, then
select which of the following commands in the class menu? Mark for Review
(1) Points
Inspect Duke()
New subclass...
Set image...
Remove Duke()
Correct
3. Which of the following Java syntax is used to correctly create a Bee subclass?
Mark for Review
(1) Points
public class Bee extends World
Correct
False
Correct
5. In Greenfoot, the turn method expects what type of information in its parameters?
Mark for Review
(1) Points
Integer of steps to move forward
Parameter void
Degrees to turn (*)
String statement
Correct
An
6. instance Mark for Review
variable (1) Points
can be
saved
and
accessed
later,
even if
the
instance
no
longer
exists.
True or
false?
True
False (*)
Correct
False
Correct
8. In Greenfoot, methods can be called in the act method. When the Act button is
clicked in the environment, the methods in the method body of the act method Mark for Review
are executed. True or false? (1) Points
True (*)
False
Correct
9. The list below provides actions you can perform in the Greenfoot code editor
except one. Which one should be removed? Mark for Review
(1) Points
Write and edit comments.
Write source code to tell the class how to act in the scenario.
Correct
10. From your Greenfoot lessons, in an if-statement, the programming statements
written in curly brackets are executed simultaneously. True or false? Mark for Review
(1) Points
True
False (*)
Correct
11. From
your Mark for Review
Greenfoot (1) Points
lessons,
how do
you know
the
program
does not
contain
syntax
errors?
Compile the code. (*)
Correct
12. From your Greenfoot lessons, which type of constructor can be used to
automate creation of Actor instances? Mark for Review
(1) Points
World (*)
Animal
Actor
Vector
Correct
13. From your Greenfoot lessons, what can methods belong to?
Mark for Review
(1) Points
(Choose all correct answers)
Galleries
Classes (*)
Scenarios
Objects (*)
Correct
14. From your Greenfoot lessons, which programming statement creates a new Bee
object, and places it at x = 120, y = 100 in the world? Mark for Review
(1) Points
Move(120,100);
15. From your Greenfoot lessons, when does an if-else statement execute it's second
code segment? Mark for Review
(1) Points
When an instance is created.
If a condition is true.
Correct