Python Programming - Encapsulation - Discussion

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

Post your comments here:

Your comments will be displayed after verification.