LearnFrenzy
Sign in Take a free test

Records, Enums and Sealed Classes · Records, Enums and Sealed Classes MCQ · Question 14

Equality of two records Answer, explanation & discussion

  • MCQ
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
Question 14 Back to Exercise

When are two records of the same type equal by equals?

  • A Only if they are the same object
  • B When all their components are equal Correct
  • C When their hash codes are equal
  • D Never
Correct Answer: Option B

So records work well as map keys and set elements.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links