Question OOP-ENC-0028
EasyA Student class lets other code set marks to −50 directly. Which change best fixes this?
- A.
Make marks a public static field
- B.
Remove the marks field
- C.
Print a warning in main()
- D.
Make marks private and add a setter that rejects invalid values
Sign up free to see the answer and a step-by-step explanation.