Question 9
Back to Exercise
Which is NOT generated automatically for record Book(String title, int pages)?
- A A title() accessor
- B Setter methods such as setPages(int) Correct
- C equals and hashCode
- D toString
Correct Answer: Option B
Records are immutable – no setters.
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!