CS 111 - 9/6/12 Lab 1 is Due Tonight!!!! Today: java Basics Variables: name that is used to reference a memory location Statement: variable declaration Variable Type: the format that the information is stored int: positive and negative whole numbers long: short: float: positive and negative real numbers double: char: stores an ASCII value String: sequence of char's boolean: a true or false value Syntax of a variable declaration statement ; Example: int value; double value2; String myName; indentifies must start with a letter and then can contain letters, digits and underscores Examples of Valid Identifies: number value37 this_is_a_very_long_identifier value73 nubmer loopCounter dfgrrf56fdfgg4 fred Assignment statement: stores information into a memory location Syntax: = ; The value respresented by the expression will be stored into the memory location associated with the identifier value = 10; value1 = value2 + value3; value1 = value2 * 5; value2 = (value1 + 7) * (value / 3); The following is a valid (and extremely useful) assignment BUT it is completely invalid in ALGEBRA value = value + 1; Output Statement: displays information to the user System.out.println ( ) ; The expression as converted to a string is displayed System.out.println ( value ); System.out.println ( "Hello World!" ); System.out.println ( "The identifier value contains: " + value );