🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Magic Methods and Properties: all 10 questions

Quiz: Magic Methods and Properties · Question 8 of 10

What is the first parameter of a @classmethod?

What is the first parameter of a @classmethod?

  1. A.self, the object
  2. B.cls, the class
  3. C.There is none
  4. D.The parent class
Answer & explanation

Correct answer: cls, the class

classmethods receive the class, which is why they suit alternative constructors.

Can you get the rest right without peeking?

Take the timed Quiz: Magic Methods and Properties quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →