What is an object reference variable?
A variable that points to some location in the computer's memory
What happens if we make a reference variable with no object in it?
It becomes a null object
How do you determine if an object is null?
You need to make an if statement in the object with a println. Like, if it is null, then something will be printed
What type of variable is an instance variable?
What happens if you follow a null reference?
You get a NullPointerException because the object is not initialized
What does a NullPointerException allow?
A method to refer to its own object, like refering to myself as I
What are multiple references to the same object called?
What happens when an assignment operation is used with object references?
The memory location is copied
What happens if an object's state is changed through a reference?
The sate of the object for all references is changed
Why does changing one reference change all references?
They all point to the same location in memory
What happens if you use == to test object references for equality?
It tests to see if the aliases are the same. You need to do nam1.equals(name2)
What happens to parameters in Java?
They are passed by value
What happens when we pass an object into a method?
It becomes an alias of the formal parameter
What is a static method?
One that does not require an object. Just do class.method()
What type of methods are the entire math class?
What is a static variable like?
They are not tied to a particular object, they are a class variable
What happens when static variables are loaded with the class?
Space is created for them because they will be used thorughout the class
What are static variables most commonly used for?
What can be interchanged in static methods?
The modifiers, but usually the visibility ones are put furst anyway
How is the main method static?
It is invoked without creating an object
What kinds of variables can be used with static methods?
Static variables or local variables. NO INSTANCE VARIABLES
What is the chain of exceptions?
A program throws exceptions which are caught or handled by other parts of the program
What is an exception?
A part of a program that describes an unusual or erroneous sistuation
How is a program divided?
The normal execution flow and the exception execution flow
What is an error in java?
An object that may sometimes represent an unrecoverable situtation and should not be caught
What is "Not Responding"?
An error that is trying to be caught but it's not really working out
What must a programmer always ensure?
An object reference variable refers to a valid object
What is a this reference?
When an object refers to itself
What does java have for when something goes wrong?
A built in set of exceptions
What can we make to go off whenever we want?
Our own exceptions
How are exceptions handled?
Ignoring it, handling it where it occurs, and handling it somewhere else in the program