Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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 =)