“In this document, you learn about the differences between class inheritance and interface implementation. Inheritance supports the creation of hierarchical frameworks of increasingly specialized classes that share some code and also add their own customizations. Interfaces allow multiple unrelated classes to share predictable sets of methods and properties. Both interfaces and inheritance provide polymorphism, allowing generic procedures to work with many different kinds of objects. You also saw how object composition allows you to reuse and extend implementation code without inheritance, and how it can be combined with interfaces to support polymorphism. All these techniques enable you to create and revise complex software systems by helping you add new functionality, with minimal need to dig back into old working code.” Read the rest of the article at MSDN.
vb is for kids
This is for VB.NET, which is pretty different than the traditional VB, furthermore, the author just used the VB.NET code as an example for his point. The article describes how to use “Inheritance and Interfaces” on ALL .NET languages, including C/C++/C#, as .NET is pretty much language-neutral.
Eugenia, you should know better than to respond to trolls. Can’t wait until I can use GNU Mono under OS X!
One day it will happen: VB will be a completely strong, clean language adhering to a well-defined parsimonious design. Each step in that journey will be met with wide-eyed wonder by the ignorant and boredom by the knowledgeable who already use capable languages.
If you want to learn about inheritance and polymorphism, get a high quality book like _Object Oriented Software Construction_; do it right or don’t bother. A self-congradulatory Microsoft introduction from 20,000 ft may be acceptable for some, but not me.
Real programmers use punch cards and carrier pigeons…
> Real programmers use punch cards and carrier pigeons…
Haha.
Nah, real programmers use what’s easiest, which in the long run turns out to be solid theory and knowhow.
By the way, I’m not a real programmer. I’m learning all I can and making rash assertions along the way.
> Real programmers use punch cards and carrier pigeons…
REAL programmers use black magic, or a ‘ttle magnet and direct hard disk access
I miss my punch cards, paper tape, and the old Sperry-Univac that was down as often as it was up. With a special request I could get 24k! Wooo-hoo, etc…
There is a very good overview for beginners of inheritance, interfaces, composition and code reuse in two of Bruce Eckel’s books, Thinking in C++ and Thinking in Java (both second editions). I think the full text of both of these books is available on his website http://www.bruceeckel.com.
Interestingly enough, both of these languages are much better than MS VeryBasic.NET.