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 * @authorthis is the Javadoc tag for documenting who created the source code 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 StringToInt
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 number=this assignment operator makes the left side equal to the right side"567";
13 String number2=this assignment operator makes the left side equal to the right side"123";
14 intint is the type for whole numbers and it is short for integer sum=this assignment operator makes the left side equal to the right side
15 Integer.parseInt(number)+adds two numbers together or concatenates Strings together
16 Integer.parseInt(number2);
17 String x=this assignment operator makes the left side equal to the right side""+adds two numbers together or concatenates Strings togethersum;
18 System.out.println(""+adds two numbers together or concatenates Strings togethersum);
19 }close braces end code blocks and must match an earlier open brace
20 }close braces end code blocks and must match an earlier open brace
|
Download/View intermediate/StringToInt.java