C# Tutorial 7 Inheritance Polymorphism

preview_player
Показать описание

If you can't donate a Like is Greatly Appreciated :)

In this part of my C# Tutorial we learn about Inheritance, Aggregations, Virtual, Override, Inner Classes, New, Base, Polymorphism and much more.

For best results take notes on the cheat sheet provided above as you watch and leave any questions you have.

Thank you to Patreon supporters like the following for helping me make this video

jaryd remillard : instagram: @distant_admiration
@kyleaisho
@thetwistedhat
vjFaLk
Рекомендации по теме
Комментарии
Автор

Thank you, Derek, for your videos, guys like you CAN change or significantly help with changing others careers or growing knowledge of programming. Guys like you started off new era of independent home learning and i am very grateful for your videos and your effort to help and teach other guys how to write a code. Thank you very much, Pavel

Pavel_Franta
Автор

8:55 it should be noted that the Animal constructor will _always_ be called first when you instantiate a Dog or any other child class. And if you don’t use :base() it will be the Animal’s parameterless constructor that runs. If you do use :base() it will call the Animal’s corresponding constructor based on what you pass to base(). But in all cases the Animal’s constructor will be called first. Use :base () if you want a specific parameterized constructor in the parent class to run when creating the child class.

mattmarkus
Автор

this is the best example for OOP inheritance and polymorphism, thank you

AlecPaulKISS
Автор

Thank you Derek, your work is greatly appreciated.

NextLevelNoob
Автор

Hey Derek, Nice video, but line 65 doesn't make sense I think. if any chars in the value are not equal to digits, set name = "No name" ELSE set name = value (IF THERE ARE NUMBERS)

JackBauerDev
Автор

I actually develop in c# all the time. It is my favorite programing language. Even though I know all this stuff I still enjoy watching these tutorials.

wizkid
Автор

Wow, you have a way of explaining things that make much more sense than most of my old programming professors! So glad I found your channel, thank you!

TheDigitalConsultant
Автор

When I watched the video, I was generally impressed because in this 24 minutes video I learned stuff that I would learn for months at school. The video is excellent despite some of the misunderstandings :)

noturbbyy
Автор

Thank you! It's been hard to find some good examples and tuorials on this stuff! You're the real MVP.

alexpajp
Автор

If Im not wrong, then you missed the other way to get deriver version of Spot's make sound method while it is still marked as New. You could check if Spot is of a Dog type and then cast it to Dog and call its Make sound method.

That way you can use both implementations if needed.

battou
Автор

Thank you very much for the pretty much comprehensive tutorials, Derek. By the way, there's an error in the Animal.cs file: the setter of the Name property shouldn't have the "!", so it should look like this "if (value.Any(char.IsDigit))" else animals' names will be "No name".

Denis
Автор

Thank you for the video Derek!!
I can' believe that my dream of getting into C# and game development is actually happening!
I can't wait for the next part!

SunnyApples
Автор

I spent ages trying to find a video to learn this. Subscribed!

RightySnipeZ
Автор

Is it just me or the way you set up the Get for Name is not right.
You have:

if(!value.Any(char.IsDigit))
{
name = "No Name"
}
name = value;

If I'm reading this correct your saying that if you don't have a digit in value then make name = "No Name" and then after that make name = value;

So if you have a digit it will make the name = "No Name" and then right after the if statement make name = value;

CanadianMang
Автор

When would i use the "new" keyword instead of overriding a method?

Mentalfrog
Автор

4:45 (!value.Any(...)) - > (should be) value.Any(...)

fedorbilev
Автор

I have watched seven c# videos today, and must say ... I am a fan! Subscribed!

AniketRajPhotographySpring
Автор

Same problem with missing an "else" clause

bartonpaullevenson
Автор

5:44 line 51 shouldn't be an 'else' before 'sound=value'? Am I wrong or it assumes sound=value no matter what?

IkonYTB
Автор

Liked the video. However, are there cases where "new" is a good idea? Based on the example here, i'd assume people's takeaway would be to just go with virtual/override.

victorcates