JF_3_1_Practice (2)
JF_3_1_Practice (2)
Lesson Objectives:
• Describe the components of the Greenfoot interactive development environment
Vocabulary:
Identify the vocabulary word for each definition below.
More specific types of a class.
The template that defines the substance of an object, such as its appearance, features, and
movement.
The more generic, overarching class of a group of classes.
An object of the class.
Translates the source code into a machine code that the computer can understand. This
ensures that you added the source code or class correctly before you proceed.
Defines what all instances of each class are capable of doing. The behavior of each instance
is determined by the source code of its class.
3. Create a new subclass of the Actor class, name it something your image will represent. Add an image to this class one of two
ways: by drawing a new image in your computer's paint program, or importing an existing image on your computer. If you
cannot draw or import an image, select an image from the Greenfoot library.
4. State what classes and subclasses are, how they are related, and their significance in programming.
Copyright © 2022, Oracle and/or its affiliates. Oracle, Java, and MySQL are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
5. Open the “leaves-and-wombats” scenario from the Chapter 1 folder of the Greenfoot textbook scenarios. Play the “leaves-and-
wombats” game. To make the wombat eat leaves, you need to add one instance of the wombat and several instances of
leaves to the scenario. To do this, right click on the class name, then select new [class name] (example: new Wombat() or new
Leaf()). With your cursor, click on the world to add the instance. Run the scenario to see the wombat eat the leaves in its path.
Copyright © 2022, Oracle and/or its affiliates. Oracle, Java, and MySQL are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. 2