Python Programming - Inheritance - Discussion

Discussion Forum : Inheritance - General Questions (Q.No. 33)
33.
How can you prevent a class in Python from being inherited by other classes?
By using the @final decorator
By defining all methods as private
By declaring the class as sealed
By not providing a superclass for the class
Answer: Option
Explanation:
In Python, a class can be prevented from being inherited by using the @final decorator.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.