|
01 packagepackage is used to name the directory or folder a class is in intermediate;
02 //start auto-imports
03 importimport means to make the classes and/or packages available in this program java.awt.geom.*;
04 importimport means to make the classes and/or packages available in this program java.awt.*;
05 //end auto-imports
06
07
08 /**
09 * All about my application.
10 * @authorthis is the Javadoc tag for documenting who created the source code Jam Jenkins
11 */
12 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 PolygonExample
13 {open braces start code blocks and must be matched with a close brace
14 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)
15 {open braces start code blocks and must be matched with a close brace
16 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 x=this assignment operator makes the left side equal to the right side{open braces start code blocks and must be matched with a close brace1, 2, 2, 1}close braces end code blocks and must match an earlier open brace;
17 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 y=this assignment operator makes the left side equal to the right side{open braces start code blocks and must be matched with a close brace1, 1, 2, 2}close braces end code blocks and must match an earlier open brace;
18 Polygon poly=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor Polygon(x, y, x.length);
19 PathIterator iter=this assignment operator makes the left side equal to the right sidepoly.getPathIterator(nullnull is the value used to refer to a non-existant object);
20 doubledouble is the type for numbers that can contain decimal fractions[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 coordinate=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor doubledouble is the type for numbers that can contain decimal fractions[brackets are typically used to declare, initialize and index (indicate which element of) arrays6]brackets are typically used to declare, initialize and index (indicate which element of) arrays;
21 whilewhile is a looping structure for executing code repeatedly(!this is the not operator, which changes true to false and false to trueiter.isDone())
22 {open braces start code blocks and must be matched with a close brace
23 intint is the type for whole numbers and it is short for integer type=this assignment operator makes the left side equal to the right sideiter.currentSegment(coordinate);
24 System.out.println("("+adds two numbers together or concatenates Strings togethercoordinate[brackets are typically used to declare, initialize and index (indicate which element of) arrays0]brackets are typically used to declare, initialize and index (indicate which element of) arrays+adds two numbers together or concatenates Strings together
25 ", "+adds two numbers together or concatenates Strings togethercoordinate[brackets are typically used to declare, initialize and index (indicate which element of) arrays1]brackets are typically used to declare, initialize and index (indicate which element of) arrays+adds two numbers together or concatenates Strings together") of type"+adds two numbers together or concatenates Strings togethertype);
26 iter.next();
27 }close braces end code blocks and must match an earlier open brace
28 }close braces end code blocks and must match an earlier open brace
29 }close braces end code blocks and must match an earlier open brace
|