D.2 Features of OOP Answers

1. Define the term encapsulation.Encapsulation in Java is a mechanism of wrapping the data (variables) and code acting on the data (methods) together as as single unit.2. Explain the advantages of encapsulation.The fields of a class can be made read-only or write-only.A class can have total control over what is stored in its fields.The users of a class do not know how the class stores its data. A class can change the...

To access the contents of this site, you must subscribe.