From FANG
|
01 packagepackage is used to name the directory or folder a class is in scg.ch08;
02
03 importimport means to make the classes and/or packages available in this program fang2.core.Game;
04
05 /** Iteration demonstration */
06 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 MoreNumbers
07 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
08 /**
09 * 1-100, 7 per line
10 */
11 @Override
12 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
13 forfor is a looping structure for repeatedly executing a block of code (intint is the type for whole numbers and it is short for integer i =this assignment operator makes the left side equal to the right side 0; i !=this is the not equals operator which evaluates to true if both sides are different 100; ++this is the increment operator, which increases the variable by 1i) {open braces start code blocks and must be matched with a close brace
14 ifif executes the next statement only if the condition in parenthesis evaluates to true (((i %this divides the left side by the right side and evaluates to the remainder 7) ==this is the comparison operator which evaluates to true if both sides are the same 0) &this performs a bit-wise and (not the same as boolean and which is &&)&this performs a bit-wise and (not the same as boolean and which is &&) (i !=this is the not equals operator which evaluates to true if both sides are different 0)) {open braces start code blocks and must be matched with a close brace
15 System.out.println();
16 }close braces end code blocks and must match an earlier open brace
17 System.out.print(" " +adds two numbers together or concatenates Strings together i);
18 }close braces end code blocks and must match an earlier open brace
19 System.out.println();
20 }close braces end code blocks and must match an earlier open brace
21 }close braces end code blocks and must match an earlier open brace
22
23 //Uploaded on Mon Mar 29 21:39:44 EDT 2010
|
Download/View scg/ch08/MoreNumbers.java