2. Object Orientation Flashcards
1
Q
Can methods and constructors be overridden or overloaded ?
A
Methods can be overridden or overloaded; constructors can be overloaded but not overridden.
2
Q
What this() and super() means (constructor context) ?
A
The first statement of every constructor must be a call either to this() (an
overloaded constructor) or to super(). The compiler will add a call to super() unless you have already put in a call to this() or super().
3
Q
Polymorphism applies for static and instance methods and variables: true of false ?
A
Polymorphism is only for instance methods, not instance variables.
Polymorphism doesn’t apply to static methods.