From ggc
|
01 importimport means to make the classes and/or packages available in this program java.util.*;
02 /**
03 * All about my application here.
04 * @authornull Jam Jenkins
05 */
06 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 AssignmentOperator
07 {open braces start code blocks and must be matched with a close brace
08 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)
09 {open braces start code blocks and must be matched with a close brace
10 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 side8;
11 System.out.println("x is "+adds two numbers together or concatenates Strings togetherx);
12 x=this assignment operator makes the left side equal to the right sidex+adds two numbers together or concatenates Strings together2;
13 System.out.println("x is "+adds two numbers together or concatenates Strings togetherx);
14 x++this is the increment operator, which increases the variable by 1;//x=x+1;
15 System.out.println("x is "+adds two numbers together or concatenates Strings togetherx);
16 System.out.println("What is your first name?");
17 Scanner scanner=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor Scanner(System.in);
18 String first=this assignment operator makes the left side equal to the right sidescanner.next();
19 intint is the type for whole numbers and it is short for integer y=this assignment operator makes the left side equal to the right sidefirst.length();
20 System.out.println("Your first name has "+adds two numbers together or concatenates Strings togethery+adds two numbers together or concatenates Strings together" characters in it.");
21 }close braces end code blocks and must match an earlier open brace
22 }close braces end code blocks and must match an earlier open brace
|
Download/View AssignmentOperator.java