Welcome to the Treehouse Community
Looking to learn something new?
Tracy ExcellFront 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?
Antonio Rodrigues2,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 =)