From ggc
|
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.math.*;
04 importimport means to make the classes and/or packages available in this program java.lang.*;
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 NumberExplore2
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 BigDecimal big=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor BigDecimal(Double.MAX_VALUE);
17 big=this assignment operator makes the left side equal to the right sidebig.add(big);
18 Number number=this assignment operator makes the left side equal to the right sidebig;
19 BigDecimal x=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor BigDecimal(number.doubleValue());
20 System.out.println("Big is "+adds two numbers together or concatenates Strings togetherbig);
21 System.out.println("big.toDouble() is "+adds two numbers together or concatenates Strings togetherbig.doubleValue());
22 System.out.println("x is "+adds two numbers together or concatenates Strings togetherx);
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 intermediate/NumberExplore2.java