Making a copy of the class read-only.

Given the following UML view, how can I get an instance BullDogthat exposes only getter methods?

  • The instance BullDogshould not have customization methods available.
  • An instance BullDogshould only have getter methods available (3 of them)

Basically the question arises: what should I do new BullDogon?

enter image description here

+5
source share
2 answers

HealthyPet Pet , , 3 getter (getMetabolism(), getName() getAge()). , HealthyPet Pet ( , ), . HealthyPet, , 3 getter (, , ).

+4

, HealthyPet Pet. BullDog HealthyPet.

+1

All Articles