From ggc
|
01 packagepackage is used to name the directory or folder a class is in intermediate;
02
03 importimport means to make the classes and/or packages available in this program wiki.Wiki;
04 importimport means to make the classes and/or packages available in this program java.util.*;
05
06 /**
07 * All about my application.
08 * @authorthis is the Javadoc tag for documenting who created the source code My Name Here
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 GreetTest
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 GreeterInterface[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 all=this assignment operator makes the left side equal to the right side{open braces start code blocks and must be matched with a close brace
15 newnew is used to create objects by calling the constructor NiceGreeter(),
16 newnew is used to create objects by calling the constructor MeanGreeter(),
17 newnew is used to create objects by calling the constructor OtherGreeter()
18 }close braces end code blocks and must match an earlier open brace;
19 Random random=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor Random();
20 intint is the type for whole numbers and it is short for integer index=this assignment operator makes the left side equal to the right siderandom.nextInt(all.length);
21 Wiki.out.println(all[brackets are typically used to declare, initialize and index (indicate which element of) arraysindex]brackets are typically used to declare, initialize and index (indicate which element of) arrays.getGreeting());
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
|
Compiler Errors:
----------
1. ERROR in intermediate/OtherGreeter.java (at line 13)
return "Hello."
^^^^^^^^
Syntax error, insert ";" to complete BlockStatements
----------
2. ERROR in intermediate/OtherGreeter.java (at line 16)
}
^
Syntax error, insert "}" to complete ClassBody
----------
2 problems (2 errors)
Download/View intermediate/GreetTest.java