Thank you i had 4 hours of sleep and i needed to get some more abstact and interface info into my brain, and as it is this weeks class subject and im trying to cram it in there.
for direct usage : for eg - Math m = new Math (); var r = m.round(3.12); // this does not make sense that is why we directly use the function like - abstraction Math.Round(3.12);
At th-cam.com/video/qgU2ojOKLP8/w-d-xo.html you say that in an abstract class we can always use virtual so even if Animal is not implementing the IAnimal interface, we can still use virtual on a method to have some default behaviour and the derived classes Dog and Cat do not have to implement MakeSound, they could implement it. But if we want to say that they have to implement it, then we have to make sure Animal implements IAnimal Interface. But with this too, if we have virtual MakeSound method in Animal class with default implementation, the derived classes work even without implementing MakeSound(). Why is this?
🚀 C# Progress Academy - Become a job-ready C# and Angular web developer to land your dream developer role: bit.ly/45vbPUg
Thank you i had 4 hours of sleep and i needed to get some more abstact and interface info into my brain, and as it is this weeks class subject and im trying to cram it in there.
This one is a saver!!!
Thanks alot❤
Clarly explained. Thank you. Anyway, is this channel still active or do you move to the tutorialseu?
Why would you use abstract classes instead of interfaces?
for direct usage :
for eg -
Math m = new Math ();
var r = m.round(3.12); // this does not make sense
that is why we directly use the function like - abstraction
Math.Round(3.12);
I think there is no need to define string as nullable object because it is already null by default if no value if given.
At th-cam.com/video/qgU2ojOKLP8/w-d-xo.html you say that in an abstract class we can always use virtual so even if Animal is not implementing the IAnimal interface, we can still use virtual on a method to have some default behaviour and the derived classes Dog and Cat do not have to implement MakeSound, they could implement it. But if we want to say that they have to implement it, then we have to make sure Animal implements IAnimal Interface. But with this too, if we have virtual MakeSound method in Animal class with default implementation, the derived classes work even without implementing MakeSound(). Why is this?