Chapter 6 Flashcards
What 3 key properties does an instance variable have?
1) Each object has its own set of instance variables
2) The scope extends throughout the entire class
3) The lifetime of an instance variable is the same as the lifetime of the object to which it belongs
The 4 key parts to an instance variable declaration/
1) An access modifier
2) A type
3) A descriptive name
4) An initial value
What does an accessor method answer?
What value does attribute X currently hold?
What 3 ways are instance variables different than temporary and parameter variables?
1) They are declared in a class but out of all methods
2) They have a larger scope - the entire class
3) They have a longer lifetime - same as the object that contains them
Define a constant variable
A special type of instance variables that doesn’t change and is written in all caps
If both variable types are int, java performs ______ division
Integer
What does overloading a method mean?
They have the same name but different signatures.