From FANG
|
01 packagepackage is used to name the directory or folder a class is in scg.ch03;
02
03 importimport means to make the classes and/or packages available in this program fang2.core.Game;
04 importimport means to make the classes and/or packages available in this program fang2.sprites.StringSprite;
05
06 // FANG Demonstration program: StringSprite
07 publicpublic is used to indicate unrestricted access (any other class can have access) classclass is a group of fields and methods used for making objects Hello
08 extendsextends means to customize or extend the functionality of a class Game {open braces start code blocks and must be matched with a close brace
09 // Called before game loop: Draws one string
10 @Override
11 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value setup() {open braces start code blocks and must be matched with a close brace
12 StringSprite string =this assignment operator makes the left side equal to the right side newnew is used to create objects by calling the constructor StringSprite("Hello");
13 string.setLineHeight(0.25);
14 string.setColor(getColor("misty rose"));
15 string.setLocation(0.5, 0.5);
16 addSprite(string);
17 }close braces end code blocks and must match an earlier open brace
18 }close braces end code blocks and must match an earlier open brace
19
20 //Uploaded on Mon Mar 29 21:39:51 EDT 2010
|
Download/View scg/ch03/Hello.java