unit 9 Flashcards
t/f: all getter methods have return types of void
false, though true for setter methods
what does the capital E stand for in the java quick reference?
object type
overridden method
subclass has same method name AND parameter list, but method does not call exact same thing as in parent class
when is super NOT super.?
in the constructor, just super()
what do you inherit?
everything PUBLIC
does return type matter in overloading?
nah
true/false: super must always be the first statement in a constructor
true
does the statement compile:
Statue eTanseer = new Gargoyle(“eshan”);
where gargoyle is a subclass of statue?
ye
when is super() implemented?
- in a constructor, when you have private variables/fields in the superclass which you want to initialize
- automatically/implicity, when a class has a parent class
what happens if super is not explicitly called and the superclass has no no-args constuctor?
compile error
are constructors inherited?
NO, thats why we use super and java calls super if you dont
when is super called automatically/invisibly?
ONLY in constructors
in the body of a class you have access to….
all the fields within that class
to override an object method…
you must use type Object as a parameter
same thing with anything else being overriden, must have same object as for method being overriden (i think?)
what is an abstract class
a class that cannot and should not be instantiated (think pet, cant create a pet w/o subclass)