C# Tutorial for Beginners 19 - Polymorphism in C#

preview_player
Показать описание
Searches related to polymorphism C#
encapsulation c#
polymorphism c# definition
polymorphism c# interview questions
runtime polymorphism c#
inheritance polymorphism c#
Introduction to inheritance, polymorphism in C#
c# - Is this the example of polymorphism?
what's the difference between inheritance and polymorphism?
C# - Types of Polymorphism in C#.Net
static polymorphism c#
polymorphism c# tutorial
polymorphism c#
Рекомендации по теме
Комментарии
Автор

Naming things is hard sometimes. Don't name the base class Drawing. That is a verb. Use a noun such as Shape. Also in your loop again don't use a verb (draw) for an object - use a descriptive noun. Finally why is everything called Obj? I see this so much in these tutorials. Call it what it is with a descriptive noun - eg shapes for example. All this leads to much more readable code and readable code is easier to understand, easier to maintain and will contain fewer bugs going forward.

davidamour
Автор

man in 11 min i understood everything thanks so much

stannisbarracuda
Автор

Why you taking array of Parent class ? is it not possible to teach Polymorphism without Array ?

AmmarTravelDiaries
Автор

"Drawing[] dObj = new Drawing[4];" Is dObj here and array of four Drawing objects or an array of Drawing object *pointers* (or possible an array of Drawing object references)? I have a C++ background, and in this example in C++ it should be an array of pointers this example to work properly. Later on you do: "dObj[0] = new Line();", so are you here copying the address  of the Line object to the dObj[0] pointer? Does "new Line();" return a pointer or an object in C#? are we dealing with pointers, references or objects here?

tryingtocorrect