Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

General Discussion

Tracy Excell
.a{fill-rule:evenodd;}techdegree seal-36
Tracy Excell
Front End Web Development Techdegree Graduate 15,333 Points

Visual Basic Polymorphism


Are there any programmers / coders out there who have used VB and are able to answer a few questions for me as part of a course I am doing? Thank you in advance.

Is polymorphism generally understood by computer programmers? Is it widely used? Does Visual Basic .NET assist the use of polymorphism, and how? When might polymorphism be used (get specific examples)? What limitations, if any, restrict its’ use?

1 Answer

Antonio Rodrigues
Antonio Rodrigues
2,306 Points

Hi, I'm a .NET developer and I've worked with VB.NET for a while. Yes, polimorphism is a very important concept and is implemented in .NET mainly through intefaces and inheritance. Inheritance makes it possible for you to have multiple classes that increment the funcionality of one another. You can have a car class, a Ferrari class, where the later is a Car too, but also has some specific basic funcionality that not all cars share. Interfaces are used as a kind of contract where you state that all classes that implement that interface will have that same propperties and methods. It is used very widely with something called dependency injection that's basically a technique that allows you too handle better the dependencies in your code. I recommend you do some research about it since it's very useful =)