When to use Interface and when Abstract class in real applications

preview_player
Показать описание
1. Full .NET Interview Course (with PDF Book)

C# / ASP.NET Core / MVC / API - Top 500 Interview Questions

Don't worry if course not helping you, Udemy has 30 days Free Refund Policy.

2. Quick Revision Book (PDF format)

Top 500 .NET Interview Questions - OOPS/ C#/ ASP.Net/ MVC/ SQL /.Net Core /Web API

50% Discount Applied on above link.

My best wishes are with you.
Рекомендации по теме
Комментарии
Автор

Ek simple analogy :
Imagine you have 10 variants of 🍔,
Each variant has different magic masala for flavour change so this "Masala" is your interface, it's present in all 🍔 but different "Masala" are used
Each 🍔 will definitely have same "tikki" this is your abstract i.e. it would be same through all variants of 🍔

devkumar
Автор

We can define concrete and static methods in an interface also. The main difference between an interface and an abstract class is that in an interface, we can't declare instance variables only constants, which are implicitly public, static, and final. This means all implementing classes must share the same value for these variables. But an abstract class can have instance variables, allowing each subclass to have its own values for these variables.

villagesoftwareengineer
Автор

Wow great simple explanation with exact point in 30 second ❤️

AnuragRawat
Автор

Tq for your knowledge sharing and this shorts approach is really nice 🤗 once again Tq

saiyandam
Автор

I am sorry if I'm wrong...but If you want method in a base class to be implemented in the same way in all derived classes, using an abstract class is not the typical approach. In an abstract class, non-abstract methods can be optionally overridden in derived classes, so they won't enforce a uniform implementation... kindly help me with this

gawalipriyanka-rgdb
Автор

Sir plz explain difference between abstract class and interface

Thinkdifferent
Автор

We can also use Static methods in interface since it is considered to be common across all the implemented classes.

Rajdeep
Автор

Very important Questions for Interview

Tq for simpley explain

santoshsatpute
Автор

Thanks for sharing this content because it is the need. Specially for programmers to know these things in a shorts Videos. Because shorts do not bore the Viewer.

waqasawan
Автор

but now you can implement body to the methods from an Interface, so it get a little bit hard to choose

jesusserratoaguilar
Автор

What about interfaces with default methods? Also what about the subclasses overriding parents' methods?

The clear and simple difference between an abstract class and an interface is STATE!
abstract classes are meant to manage state whereas interfaces don't

yohanebergerkouokamkuisu
Автор

Abstract class treats as interface but only for their own derived class not for others. But Interface can be implements for others.

Anuj_sk
Автор

@interviewhappy please do some more questions like short videos it will help to all, they will not get boor.

ramyask
Автор

Hi sir, I need full video link.kindly pls share

anushashaik
Автор

Can we override the defined method in abstract class in derived class? If yes, then "blue" can be changed to "Red" in derived class.right?

nagaraj
Автор

how can anyone declare abstract class with public keyword

rakeshbhure
Автор

interface will note have access modifier sir 😅😅 your interface example is wrong

preetishchindarkar
Автор

Bro your concepts are not clear we can have static and default methods slso in interface

Golbyzshorts
Автор

I thought it's java until I saw "Console. ..."

nandorboda
Автор

Your accent is strong and it is hard to understand

nameistverborgen