ExamVeda
Login
Home
This question belongs to PHP Object Oriented Concept
Object Oriented Concept
?

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
    }
}

Answer & Solution
Correct Answer: Option D
A final class cannot be subclassed. Less drastically, a final method cannot be overridden.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.