From the course: Visual Basic Essential Training

Unlock this course with a free trial

Join today to access over 24,500 courses taught by industry experts.

Interface inheritance

Interface inheritance

- [Instructor] Interface inheritance is different yet useful. With interfaces, we define the methods and properties that we want in a class within the interface. The interface itself doesn't contain any implementation code. It only holds the signature definitions of the methods and properties. To use the interface, we implement it in other classes. These implementing classes are responsible for providing the actual code and logic for the methods and properties defined by the interface. After defining the interface and implementing it in the concrete classes, the real magic happens when we can use those classes to interact with other parts of our code or the .NET libraries. So what we're looking at here is a class diagram that shows two types, my type called Robot, and one of the .NET types called Decimal. And these lines sticking out of the top with a circle on the top. Those show the interfaces that are implemented in this type. So my Robot class implements one IComparable. The…

Contents