Professional Documents
Culture Documents
4600 Study Guide
4600 Study Guide
Example
private ArrayList<ClockDisplay>clockList;
private int x;
String, int, and Boolean - CANNOT BE VOID, these will always return a value, will
contain a return statement to return the value. Return means it finishes the method
and take you out of the method.
Strings represent text
MUTATOR
This is used to change an objects state. (use void)
Public void insertMoney (int amount) - amount is a parameter, it goes into the
function
{
balance = balance + amount; (balance is being mutated, balance + amount
is the assignment statement)
Variables
-
Field variables
-
Parameter variable
-
local variables
-
index ++;
is index = index + 1;
LOOPS (for and while)
For loops
For (int I =0; i < 10; i++)
{
System.out.println(I is equal to + i)
}
While i is less than 10 and increment by 1 every loop.