Examveda

What is the purpose of the @staticmethod decorator in advanced OOP?

A. To define methods that operate on instances

B. To define methods that operate on classes

C. To define methods that can be overridden

D. To define methods that require arguments

Answer: Option B

Solution (By Examveda Team)

The @staticmethod decorator is used to define methods that operate on classes, not instances.

This Question Belongs to Python Program >> Advanced OOP Concepts

Join The Discussion

Related Questions on Advanced OOP Concepts

What is inheritance in OOP?

A. Creating new objects from existing ones

B. Allowing objects to share attributes and methods

C. Restricting access to object attributes

D. Converting classes into objects