Question OOP-ENC-0025
EasyWhich of these breaks encapsulation the most?
- A.
Making fields private
- B.
Making every field of a class public
- 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
Which of these breaks encapsulation the most?
Making fields private
Making every field of a class public
Sign up free to see the answer and a step-by-step explanation.
Validating values in a setter
Providing a getter for a field