C# method overriding

C# method overriding

Bro Code

3 года назад

42,561 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@BroCodez
@BroCodez - 23.06.2021 16:08

using System;

namespace MyFirstProgram
{
class Program
{
static void Main(string[] args) {

//method overriding = provides a new version of a method inherited from a parent class
// inherited method must be: abstract, virtual, or already overriden
// Used with ToString(), polymorphism

Dog dog = new Dog();
Cat cat = new Cat();

dog.Speak();
cat.Speak();

Console.ReadKey();
}
}
class Animal
{
public virtual void Speak()
{
Console.WriteLine("The animal goes *brrr*");
}
}
class Dog : Animal
{
public override void Speak()
{
Console.WriteLine("The dog goes *woof*");
}
}
class Cat : Animal
{

}
}

Ответить
@milorday5141
@milorday5141 - 23.01.2024 16:03

thank you

Ответить
@abdelrahmangomaaabbady
@abdelrahmangomaaabbady - 03.01.2024 11:51

Wonderful tutorial, great thanks.

Ответить
@goverdhanjayaram3683
@goverdhanjayaram3683 - 31.12.2023 09:56

Super effective !! Thank you !

Ответить
@the_dude_josh
@the_dude_josh - 28.12.2023 05:16

A random comment down below.

Ответить
@abhinay4200
@abhinay4200 - 28.11.2023 04:17

What about new Keyword what happens when parent method is virtual and child is new

Ответить
@sametayaz4891
@sametayaz4891 - 02.11.2023 15:23

what does the fox say?

Ответить
@McPatoo
@McPatoo - 01.11.2023 00:22

🗿🗿🗿🗿🗿 Done!

Ответить
@JugalSingh
@JugalSingh - 25.10.2023 19:34

great video

Ответить
@qnghost253
@qnghost253 - 19.10.2023 18:49

Simple and helpful

Ответить
@AmanSharma-hg2wy
@AmanSharma-hg2wy - 18.09.2023 10:18

Ответить
@janisvirsnitis8312
@janisvirsnitis8312 - 24.08.2023 15:54

.

Ответить
@linus3k
@linus3k - 06.07.2023 08:43

very good vid, to the point and very good explanation.

Ответить
@mertkurt947
@mertkurt947 - 02.06.2023 18:44

yea maaaaaaaaan , super helpful

Ответить
@FaizyPlayz786
@FaizyPlayz786 - 28.05.2023 14:07

Ответить
@LuizHenrique-gm1cc
@LuizHenrique-gm1cc - 25.05.2023 19:42

Thanks bro!

Ответить
@amalamel6727
@amalamel6727 - 06.05.2023 19:10

Thanks

Ответить
@MrSK168
@MrSK168 - 13.04.2023 10:41

Very good explanations!
Thanks for sharing.

Ответить
@s0nnyv123
@s0nnyv123 - 04.02.2023 21:38

Thank you! This clarifies my confusion as to when and the difference that a method can be overriden if whether its from a regular class or abstract class.

Ответить
@Shakyareno
@Shakyareno - 25.01.2023 23:18

bro,.. great videos, so simple and straight to the point. good review!

Ответить
@pajkeav
@pajkeav - 24.01.2023 20:04

nice

Ответить
@courtneywoodcock5696
@courtneywoodcock5696 - 08.01.2023 02:47

thanks

Ответить
@FullExtension1
@FullExtension1 - 06.12.2022 01:43

you are such a bro, bro.

Ответить
@badrbennani3801
@badrbennani3801 - 21.11.2022 22:35

very helpful video. thanks

Ответить
@johneconomou567
@johneconomou567 - 12.10.2022 01:58

broooooooooo amazing

Ответить
@Proviper666
@Proviper666 - 07.08.2022 23:17

1

Ответить
@Astroweasels
@Astroweasels - 07.08.2022 06:05

But what does the fox say?

Ответить
@BenBerke
@BenBerke - 06.08.2022 22:53

so whats the point of overriding? Why not just create a new method that just prints a line?

Ответить
@marionella175
@marionella175 - 12.07.2022 21:46

Wow! I've spent more than 15 minutes listening to a video on my C# course about it, I almost fell asleep and absolutely didn't get how method overriding works, BUT 2 minutes of your video and I get it so clear. Thank you very much!

Ответить
@triton5457
@triton5457 - 27.03.2022 03:03

good vid bro

Ответить
@whitedinamo
@whitedinamo - 04.02.2022 16:02

lesson check😇

Ответить
@EchoVids2u
@EchoVids2u - 01.02.2022 21:52

Why does it still work without putting override and virtual

Ответить
@vishwajeetpanwar3271
@vishwajeetpanwar3271 - 12.12.2021 16:11

VRO thanks Short and Effective just perfect

Ответить
@cn-ml
@cn-ml - 01.12.2021 16:23

My compiler says the derived class has to use either override or new? What is new used for in this context?

Ответить
@DivanProdOfficial
@DivanProdOfficial - 21.11.2021 15:40

so short and effective!! thank you for not wasting my time!

Ответить
@spartanranger
@spartanranger - 27.08.2021 04:47

Thanks for the video Bro.

Ответить
@HoeTran
@HoeTran - 11.07.2021 11:52

Thanks Bro!

Ответить
@Dadax9398
@Dadax9398 - 03.07.2021 23:44

The thumbnails always get me x)

Ответить
@Bear-nr9jo
@Bear-nr9jo - 03.07.2021 17:05

Great vid bro, you helped me understand c# :D

Ответить