We have initially defined 3 private variables. These variables cannot be 'seen' from outside this class module. This gives the benefit that the only way they can be changed is to use our Properties that we have created. AnimalType AnimalColour AnimalLegs See Diagram 2 Notice that there is no reference to any of the private variables that we declared. As with other modules, module level variables in a class module can be declared as either public or private.
Private variables are only accessible to code within the class module.
They are the preferred way to manage data within a class. This also allows us to implement validation or business rules against any values that the client attempts to change. Any instance variables declared as public are accessible to code within our class module, but they are also directly accessible to any client code written to use our object. Use of public variables is not recommended. Client code can directly manipulate a public instance variable without using any of our class code, thereby bypassing any business rules that may exist.