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

Quiz: Type Hints and Dataclasses · Question 4 of 10

Which methods does a plain @dataclass generate?

Which methods does a plain @dataclass generate?

  1. A.Only init
  2. B.init, hash and lt
  3. C.init, repr and eq
  4. D.str and len
Answer & explanation

Correct answer: init, repr and eq

Ordering and hashing need extra options such as order=True or frozen=True.

Can you get the rest right without peeking?

Take the timed Quiz: Type Hints and Dataclasses quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →