Question OOP-ENC-0067
HardWhy do Java beans' setters sometimes violate encapsulation?
- A.
They hide fields completely
- B.
They prevent serialisation
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Encapsulation question
Why do Java beans' setters sometimes violate encapsulation?
They hide fields completely
They prevent serialisation
Sign up free to see the answer and a step-by-step explanation.
They expose every field for modification, often without validation
They make fields final