|
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 LinearSearch
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 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 nums=this assignment operator makes the left side equal to the right side{open braces start code blocks and must be matched with a close brace3, 65, 13, 67, 1, 45, 23, -2, 6, 1}close braces end code blocks and must match an earlier open brace;
10 booleanboolean is a type that is either true or false lucky=this assignment operator makes the left side equal to the right sidetruetrue is the boolean value that is the opposite of false;
11 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 side0; i<nums.length; i++this is the increment operator, which increases the variable by 1)
12 {open braces start code blocks and must be matched with a close brace
13 System.out.println("Looking at: "+adds two numbers together or concatenates Strings togethernums[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);
14 ifif executes the next statement only if the condition in parenthesis evaluates to true(nums[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==this is the comparison operator which evaluates to true if both sides are the same13)
15 {open braces start code blocks and must be matched with a close brace
16 lucky=this assignment operator makes the left side equal to the right sidefalsefalse is a value for the boolean type and means not true;
17 System.out.println("Bad Luck!!!!");
18 }close braces end code blocks and must match an earlier open brace
19
20 System.out.println("Lucky is now "+adds two numbers together or concatenates Strings togetherlucky);
21 }close braces end code blocks and must match an earlier open brace
22 System.out.println("Finally, the stack is "+adds two numbers together or concatenates Strings togetherlucky);
23 }close braces end code blocks and must match an earlier open brace
24 }close braces end code blocks and must match an earlier open brace
|