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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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().

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly