|
01 packagepackage is used to name the directory or folder a class is in GBell;
02
03 importimport means to make the classes and/or packages available in this program wiki.Wiki;
04
05 /**
06 * All about my game here.
07 * @authorthis is the Javadoc tag for documenting who created the source code Gbell
08 * with ideas from Jam Jenkins and Jason Park
09 */
10 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 LightsOutPractice
11 {open braces start code blocks and must be matched with a close brace
12 publicpublic is used to indicate unrestricted access (any other class can have access) staticstatic means that an instance is not required for access (class level access) voidvoid means the method does not return a value mainThe main method is the place where applications begin executing.(String[brackets are typically used to declare, initialize and index (indicate which element of) arrays]brackets are typically used to declare, initialize and index (indicate which element of) arrays args)
13 {open braces start code blocks and must be matched with a close brace
14 intint is the type for whole numbers and it is short for integer[brackets are typically used to declare, initialize and index (indicate which element of) arrays]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arrays]brackets are typically used to declare, initialize and index (indicate which element of) arrays cells =this assignment operator makes the left side equal to the right side newnew is used to create objects by calling the constructor intint is the type for whole numbers and it is short for integer[brackets are typically used to declare, initialize and index (indicate which element of) arrays5]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arrays5]brackets are typically used to declare, initialize and index (indicate which element of) arrays;
15 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 r=this assignment operator makes the left side equal to the right side0; r<cells.length; r++this is the increment operator, which increases the variable by 1)
16 {open braces start code blocks and must be matched with a close brace
17 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 c=this assignment operator makes the left side equal to the right side0; c<cells[brackets are typically used to declare, initialize and index (indicate which element of) arrays0]brackets are typically used to declare, initialize and index (indicate which element of) arrays.length; c++this is the increment operator, which increases the variable by 1)
18 {open braces start code blocks and must be matched with a close brace
19 cells[brackets are typically used to declare, initialize and index (indicate which element of) arraysr]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arraysc]brackets are typically used to declare, initialize and index (indicate which element of) arrays=this assignment operator makes the left side equal to the right side1;
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 Wiki.out.println("--------------");
23 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 < cells.length; i++this is the increment operator, which increases the variable by 1)
24 {open braces start code blocks and must be matched with a close brace
25 Wiki.out.print("|");
26 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 u =this assignment operator makes the left side equal to the right side 0; u < cells.length; u++this is the increment operator, which increases the variable by 1)
27 {open braces start code blocks and must be matched with a close brace
28 Wiki.out.print(cells[brackets are typically used to declare, initialize and index (indicate which element of) arraysi]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arraysu]brackets are typically used to declare, initialize and index (indicate which element of) arrays +adds two numbers together or concatenates Strings together "|");
29 }close braces end code blocks and must match an earlier open brace
30 Wiki.out.println();
31 Wiki.out.println("--------------");
32 }close braces end code blocks and must match an earlier open brace
33 }close braces end code blocks and must match an earlier open brace
34 }close braces end code blocks and must match an earlier open brace
|