Consider the following code:
class Base{ private float f = 1.0f; void m (float f1){ this.f = f1; } } class Base2 extends Base{ private float f = 2.0f; //1 }
Which of the following options is a valid example of overriding?
Select 2 options
Correct Options are : A C
An overriding method can be made less restrictive than the overridden method.
The restrictiveness of access modifiers is as follows:
private>default>protected>public (where private is most restrictive and public is least restrictive).
Note that there is no modifier named default.
The absence of any access modifiers implies default access.