i. hasNext, getNext, lookAtNext, rewind
i. Bring last years exam/sample questions, and
your questions
1. We can go through things together, etc – but,
I won’t be lecturing
ii. Note – I might be a little late, I have a
commitment at 4
i. For example, in our country example
i. Constructor example – Random(), Random(int
seed)
ii. Method example – random.nextInt() and
random.nextInt(int a)
i. Public vs private, static vs instance,
parameter names don’t matter here
Access Levels Modifier Class Package
Subclass World
public
Y Y Y Y
protected
Y Y Y N
no
modifier Y Y N N
private Y N N N
i. Instance variables – private
ii. Instance methods – public
iii. Instance helper methods - private
iv. Constructors – public
v. Static/class methods – public
vi. Static/class variables – private
vii. Static/class constants – public
viii.
Local variables
– usually don’t specify
1. Why?
Because it doesn’t really matter, due to variable scope
ix. Parameter Variables – same as local variables
i. instanceof
1. This is a keyword
2. Says whether or not an object has some type
ii. Convert generic object to specific type
1. Every Java object ‘inherits’ some things from
the object class
2. We can convert a generic object to an object
of a specific type by using (<Class>) in front of the variable (if we
know that object is the right type – see instanceof)
public boolean equals(Object other){
if(other instance of
<class>){
<class>
that=(<class>) other;
//do comparisons, return true or false
}
return false;
}