Question:what are the benefits of encapsulation? 

Answer 1. Encapsulated Code is more flexible and easy to change with new requirements.
2. Encapsulation in Java makes unit testing easy.
3. Encapsulation in Java allows you to control who can access what.
4. Encapsulation also helps to write immutable class in Java which are a good choice in multi-threading
environment.
5. Encapsulation reduce coupling of modules and increase cohesion inside a module because all piece of one thing
are encapsulated in one place.
6. Encapsulation allows you to change one part of code without affecting other part of code.
 


Deprecated: html_entity_decode(): Passing null to parameter #1 ($string) of type string is deprecated in D:\webserver\www\vcampusbd_com_https\answers\column_answer_two.php on line 128
+ Report
Total Preview: 1015
what are the benefits of encapsulation?
Copyright © 2024. Powered by Intellect Software Ltd