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 BankAccountTest
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 BankAccount account;
13 account=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor BankAccount();
14 intint is the type for whole numbers and it is short for integer message;
15 message=this assignment operator makes the left side equal to the right sideaccount.toString();
16 System.out.println("Hello "+adds two numbers together or concatenates Strings togethermessage);
17 }close braces end code blocks and must match an earlier open brace
18 }close braces end code blocks and must match an earlier open brace
|
Compiler Errors:
----------
1. ERROR in intermediate/BankAccountTest.java (at line 15)
message=account.toString();
^^^^^^^^^^^^^^^^^^
Type mismatch: cannot convert from String to int
----------
1 problem (1 error)
Download/View intermediate/BankAccountTest.java