Wombat Classes Basics (Young Developers Series, Part 2)
By dananourie on Aug 12, 2008
|By Dana Nourie, August 2008||
Learn where Java code is written and saved, how classes relate to one another, and how to use the Greenfoot code editor.
In the Wombat Object Basics article, you learned what an object is, what methods are for, and a bit about the syntax that is used in code. In this article, you will learn where that code is written and saved, how classes relate to one another, and you'll learn to use the Greenfoot code editor. In addition, certain words in this article are linked, so you can learn more than is being taught here.
As in the last article, to follow along you will need:
This article is aimed at anyone interested in Java programming who is between the ages of 10-100 and has no programming experience. It is recommended that you have read and followed Wombat Object Basics before moving on in this article.
Now that you understand that Java programs are made up of a lot of Java objects, and they interact through methods that provide the instructions for doing things, you are ready to learn about the code. Let's not waste any time.
Open Greenfoot. If the Wombats scenario is not already open, Click Scenario in the top menu, choose Open, select wombats, and then click Open.
At the top of the world area, right-click
wombatWorld and select
void populate(). By invoking that
void populate() method, you should now see a few wombats and lots of leaves in your wombat world as shown in Figure 1.