From ggc
|
01 importimport means to make the classes and/or packages available in this program java.util.*;
02 /**
03 * All about my classclass is a group of fields and methods used for making objects here.
04 * @authorthis is the Javadoc tag for documenting who created the source code Jam Jenkins
05 */
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 ConsoleEngine
07 {open braces start code blocks and must be matched with a close brace
08 privateprivate is used to restrict access to the current class only Scanner scanner;
09 publicpublic is used to indicate unrestricted access (any other class can have access) ConsoleEngine()
10 {open braces start code blocks and must be matched with a close brace
11 scanner=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor Scanner(Wiki.in);
12 }close braces end code blocks and must match an earlier open brace
13
14 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value giveOutput(String output)
15 {open braces start code blocks and must be matched with a close brace
16 Wiki.out.println(output);
17 }close braces end code blocks and must match an earlier open brace
18
19 publicpublic is used to indicate unrestricted access (any other class can have access) String getInput()
20 {open braces start code blocks and must be matched with a close brace
21 returnreturn means to provide the result of the method and/or cease execution of the method immediately scanner.next();
22 }close braces end code blocks and must match an earlier open brace
23 }close braces end code blocks and must match an earlier open brace
|
Download/View ConsoleEngine.java