Instance Variables and Class Methods
One of the strengths of the OO approach is that data is hidden from other objects or processes (data hiding). In order to hide data, instance variables are declared with the keyword Private.

As mentioned, encapsulation limits access to data by using a concept called data hiding. However, there must be some way of accessing the object itself. Access to an object becomes possible when the programmer provides the object with public methods. For example, if the designer decides to allow the Name property to be viewed or changed, the public methods below can be provided.

Note that the methods are declared as Public. This allows them to be visible as part of the class's interface. This is much like the "signature" that we discussed with subs and functions. In that case the "visible" part of a sub or function was the name, and the order, type, and number of parameters. In the case of classes, the visible portion is the class name, and any Public members. The designer purposely limits the members that are declared as Public so as to restrict access to the object and prevent accidental or malicious tampering.
The code above demonstrates accessor (get) and mutator (set) methods. When access to private data members is restricted to the public methods, the designer controls how objects can be manipulated. For example, accessor and mutator methods may not be provided for every data member. Further, mutator methods can (and should) include code to perform data validation, such as range checking, or may translate between the form of the data used in the interface and the form used in the implementation.
Sidebar: Why use accessor and mutator methods instead of just making the instance variables Public?
Most OOP languages code accessor and mutator methods like other methods, so the approach used in the code above is similar to that used in other languages like Java. VB provides "property procedures" that perform a similar function, but have a somewhat different implementation. Both approaches will be presented in an effort to make the concepts applicable beyond VB.
Property Procedures
Visual Basic provides special methods called Property Let, Property Set, and Property Get. Serving the same purpose as the accessor and mutator methods discussed above, their implementation is somewhat different.
A Property Get method is used to return the value of an instance variable (like the accessor method).
A Property Let method is used to assign a new value to an instance variable (like the mutator method).
A Property Set method is used to set a reference to an object. This assumes that the class contains an instance variable that is itself an object. Set is needed because Let cannot be used to assign a value to an object.

Note that the instance variable must have a different name (i.e., JobCode) than the name of the Get and Let methods (i.e., Job). Because of this last fact, many programmers prefer to begin instance variable names with an "m" so that the Get and Set methods accurately reflect the item being read or altered. For example, the code above might include the instance variables mDependents and the methods Set Dependents and Get Dependents. The method call might then look like Emp.Dependents = 3
Constructors
Classes also provide for methods that are run whenever an object is instantiated from a class. These are known as constructors in most programming languages, and are provided to allow for initialization of any class members that require a value different from the default. Referred to as the Initialize event in VB, they are declared as a Private Sub with the name Class_Initialize.

Method Class_Initialize can call other methods of the class, such as Property Let or Property Get methods. In VB, no parameters can be passed to Class_Initialize.
Destructors
Similarly, classes provide for methods that are run whenever an object is deallocated. These are often referred to as destructors, and are used to return to the system any resources that were used by the object, but are no longer needed. Referred to as Terminate events in VB, they are declared as a Private Sub with the name Class_Terminate.

Note that it is common practice to declare the instance variables at the beginning of the class, before the methods. The constructor is usually the first of the methods, and the destructor is the last.

The above example also shows the calls to the accessor and mutator methods, as well as calls to the Property Set and Property Get methods.
Note that an object can be deallocated by setting its reference to Nothing:
Set Emp = Nothing