?
What will be the output of the following PHP code?
What will be the output of the following PHP code?
class Checkout
{
final function totalize()
{
// calculate bill
}
}
class IllegalCheckout extends Checkout
{
final function totalize()
{
// change bill calculation
}
}
class Checkout
{
final function totalize()
{
// calculate bill
}
}
class IllegalCheckout extends Checkout
{
final function totalize()
{
// change bill calculation
}
}
Answer & Solution
Correct Answer:
Option
D
A final class cannot be subclassed. Less drastically, a final method cannot be overridden.
Join the Discussion
Login to post a comment or share your explanation.
Login