The Shape base class and the Shapes derived class work fine, but there’s a potential problem. A new derived class that implements a new shape may not override the Area or the Perimeter method. If you want to force all derived classes to implement a specific method, you can specify the MustInherit modifier for the […]Read More...
Working with Objects
The MyBase and MyClass keywords let you access the members of the base class and the derived class explicitly. To see why they’re useful, edit the ParentClass, as shown here:
Public Class ParentClass
Public Overridable Function Method1() As String
Public Overridable Function Method4() As String
Return ("I’m the original Method4")
Override Method4 in the derived class, as shown here:
Public Class DerivedClass
Overrides Function Method4() As String
Switch to the test form, add a button, declare a variable of the derived […]Read More...
Classes are quite simple to build and use, and so is OOP. There are even tools to help you design and build your classes, which I’ll describe briefly here. You can use the Class Diagram Designer to build your classes with point-and-click operations, but you can’t go far on this tool alone. The idea is […]Read More...