Category : Tutorials » Visual Basic Programming
. essence of a class and thus the part that VB supports for us since . Whilst VB doesn't allow us to derive our classes from a common base class, it does .
Download File
Free PDF eBooks Download
Tutorials
Visual Basic Programming
Content Summary :
Encapsulation: This is the essence of a class and thus the part that VB supports for us since it supports the class structure. You can most likely work out the meaning of the term by looking at the word – encapsulate – The dictionary defines this as “Enclose in or as in a capsule” and this is exactly what a class does. If you think of the class itself as the “Capsule” then the data and methods contained within it are hidden from the outside world, accessible only through what’s known as the “Public interface” which are the public properties, methods and events exposed by the class. In essence the internal workings and data stored within a class are known only to itself, the outside world only gets access to what is specifically exposed. Inheritance: This is where the object is abstracted into a more generalised form then further classes a built using the generalised class as a base. These further classes “Inherit” the functionality of the base class and can also include further functionality of their own thus extending the base class. These classes are called “Derived” classes as they derive their functionality from their parent class. An example of this would be the base class “Vehicle”. Inherited from that would be the class “Car” which would support everything a vehicle does, and extra things a car does. The class “Ferrari” would be inherited from the Car class adding more things specific to Ferrari model cars and so on.