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 TMNT
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 String hello=this assignment operator makes the left side equal to the right side"Teenage";
13 String other=this assignment operator makes the left side equal to the right sidehello;
14 hello+=this increases the variable on the left by the value on the right" Mutant";
15 Wiki.out.println("hello is "+adds two numbers together or concatenates Strings togetherhello);//Teenage
16 Wiki.out.println("other is "+adds two numbers together or concatenates Strings togetherother);//Teenage
17
18 StringBuffer helloBuffer=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor StringBuffer("Teenage");
19 StringBuffer otherBuffer=this assignment operator makes the left side equal to the right sidehelloBuffer;
20 helloBuffer.append(" Mutant");
21 Wiki.out.println("helloBuffer is "+adds two numbers together or concatenates Strings togetherhelloBuffer);//Teenage Mutant
22 Wiki.out.println("otherBuffer is "+adds two numbers together or concatenates Strings togetherotherBuffer);//Teenage Mutant
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/TMNT.java