Python Programming - Encapsulation - Discussion

Discussion Forum : Encapsulation - General Questions (Q.No. 24)
24.
What is the role of the @classmethod decorator in encapsulation?
To define a private variable
To create a class instance
To provide a class method for a class
To access a global variable
Answer: Option
Explanation:
The @classmethod decorator is used in encapsulation to provide a class method for a class, allowing functionality related to the class.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.