Question 20
Back to Exercise
What does record Point(int x, int y) {} generate?
- A Public mutable fields
- B Private final fields, a constructor, accessors x() and y(), equals, hashCode and toString Correct
- C Getters and setters
- D Only a constructor
Correct Answer: Option B
Records are encapsulated, immutable data carriers.
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!