Variables and Types

Variable
Data in memory is referred to by name. This is called a variable. You can think of a variable name as the human-usable equivalent of a memory address.
Type
Every variable has a type (what kind of thing it is). Eg, int, String, ...
Declaration
Every variable must be declared once before using it. This tells the compiler that you're going to use it, and what kind of a thing it is.
   String fullName;
Value
Every variable has a value. You can use the value in a calculation, or assign a new value to a variable. All variables must have a value assigned to them before they can be used.
   fullName = "Michael Mortimer Maus";

Assignment statement

An assignment statement has this form.

   variable = expression;

Where expression can be one of the following:

Types

Numeric types

More than one variable in same declaration

It's possible to declare more than one variable in the same declaration.

   double height, weight;

But I would prefer that you put them in separate declarations. It makes documenting them easier, and avoids errors in certain cases.

   double height;  // Height in centimeters.
   double weight;  // Weight in kilograms.

Declaring and initializing in one statement.

Before you can use a variable, you have to declare it and initialize it.

   String fullName;
   fullName = "nobody";

It is common to initialize a variable in the declaration.

   String fullName = "nobody";

Numeric operators

Precedence and the order of operations

String Concatenation

Common String methods (Wu p61...)

String s1 = "goodbye";
String s2;
int    i;

End