From ggc
|
01 /**
02 * All about my application here.
03 * @authorthis is the Javadoc tag for documenting who created the source code Jam Jenkins
04 */
05 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 GuessingGame
06 {open braces start code blocks and must be matched with a close brace
07 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)
08 {open braces start code blocks and must be matched with a close brace
09 Guess guess;//declares
10 guess=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor Guess();//initializes
11 whilewhile is a looping structure for executing code repeatedly(guess.gameIsOver()==this is the comparison operator which evaluates to true if both sides are the samefalsefalse is a value for the boolean type and means not true)
12 {open braces start code blocks and must be matched with a close brace
13 guess.requestNumber();
14 guess.giveHint();
15 guess.remaining();
16 }close braces end code blocks and must match an earlier open brace
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
|
Download/View GuessingGame.java