Object-Oriented Differences

Object-oriented programming is based on some unique principles. These principles are discussed in detail in Part II, but here we need to get a brief introduction to them.

Inheritance

An important principle of object-oriented programming is inheritance, which is covered in Chapter 12. Classes (that is, reference types) support inheritance, whereas structures (value types) do not. Consider the following code:

Class Person    Property FirstName As String    Property LastName As StringEnd ClassClass Developer    Inherits Person    Property UsedProgrammingLanguage As String    Public Overrides Function ToString() As String        Return Me.LastName    End FunctionEnd Class

In this example, ...

Get Visual Basic 2015 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.