+ 1
The Foo() method cannot be overridden in a child class. Why?
The Foo() method cannot be overridden in a child class. Why? class A { final function Foo() { echo "A"; } } class B extends A { function Foo() { echo "B"; } } - None of the options - class A is private - "this" keyword is missing - final methods cannot be overridden Please help me for this.
3 Answers
+ 5
final methods cannot be overridden
0
u need to make it virtual && the final keyword stops child classes from overriding it
- 1
final methods cannot be overridden