From ggc
|
01 packagepackage is used to name the directory or folder a class is in intermediate;
02
03
04 /**
05 * All about my application.
06 * @authornull My Name Here
07 */
08 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 DNCReporting
09 {open braces start code blocks and must be matched with a close brace
10 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)
11 {open braces start code blocks and must be matched with a close brace
12 DefiniteNumericCollection[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 sidenewnew is used to create objects by calling the constructor DefiniteNumericCollection[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
13 {open braces start code blocks and must be matched with a close bracenewnew is used to create objects by calling the constructor MyDefiniteNumericCollection()}close braces end code blocks and must match an earlier open brace;
14 DefiniteNumericCollectionTest[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 allTests=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor DefiniteNumericCollectionTest[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
15 {open braces start code blocks and must be matched with a close bracenewnew is used to create objects by calling the constructor MyTest()}close braces end code blocks and must match an earlier open brace;
16 forfor is a looping structure for repeatedly executing a block of code(DefiniteNumericCollection dnc: all)
17 {open braces start code blocks and must be matched with a close brace
18 forfor is a looping structure for repeatedly executing a block of code(DefiniteNumericCollectionTest test: allTests)
19 {open braces start code blocks and must be matched with a close brace
20 trytry is for executing a code block that may experience exceptions (errors)
21 {open braces start code blocks and must be matched with a close brace
22 test.runTests(dnc);
23 System.out.println("Pass report:\n"+adds two numbers together or concatenates Strings togethertest.getPassReport());
24 System.out.println("Fail report:\n"+adds two numbers together or concatenates Strings togethertest.getFailReport());
25 }close braces end code blocks and must match an earlier open brace
26 catchcatch means to handle an exception that may occur(Exception e)
27 {open braces start code blocks and must be matched with a close brace
28 e.printStackTrace(System.out);
29 System.out.println("Ooops, your test had bugs in it.");
30 }close braces end code blocks and must match an earlier open brace
31 }close braces end code blocks and must match an earlier open brace
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
|
Download/View intermediate/DNCReporting.java