From ggc
|
01 packagepackage is used to name the directory or folder a class is in jam;
02
03 importimport means to make the classes and/or packages available in this program wiki.Wiki;
04 /**
05 * All about my application here.
06 * @authornull Jam Jenkins
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 YouAreMyType
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 intint is the type for whole numbers and it is short for integer x=this assignment operator makes the left side equal to the right side5;
13 longlong is the type for whole numbers (they have a larger range than int) z=this assignment operator makes the left side equal to the right side3200000000l;
14
15 doubledouble is the type for numbers that can contain decimal fractions y=this assignment operator makes the left side equal to the right side5.5;
16 floatfloat is the type for numbers that can contain decimal fractions q=this assignment operator makes the left side equal to the right side5.6f;
17
18 String name=this assignment operator makes the left side equal to the right side"Jelly";
19 intint is the type for whole numbers and it is short for integer howLong=this assignment operator makes the left side equal to the right sidename.length();
20 String part=this assignment operator makes the left side equal to the right sidename.substring(1, 3);
21 intint is the type for whole numbers and it is short for integer happy=this assignment operator makes the left side equal to the right side5;
22 intint is the type for whole numbers and it is short for integer r=this assignment operator makes the left side equal to the right sidehappy+adds two numbers together or concatenates Strings together9;
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
|
Download/View jam/YouAreMyType.java