![]() It has three private fields, and each has its own pair of getter and setter methods. The Animal class below is fully encapsulated. To do so, you need to declare the fields as private and provide access to them with getter and setter methods. With encapsulation, you can protect the fields of a class.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |