OOPS Interview Questions and Answers | Object Oriented Programming Interview Questions C#

  Рет қаралды 664,851

Questpond

Questpond

Күн бұрын

Пікірлер: 428
@questpondvideos
@questpondvideos 2 жыл бұрын
30 Important C# Interview Questions : kzbin.info/www/bejne/eHzcn3h4hdacf68 Software Architecture Interview Questions : kzbin.info/www/bejne/d6W3mJaYgbSkg68 20+ Garbage Collection (GC) Interview Questions : kzbin.info/www/bejne/iJjJpommZ9GLf6M 20+ SQL Server Interview Questions : kzbin.info/www/bejne/iXbHcnluorh-iZY 10+ Power BI Interview Questions : kzbin.info/www/bejne/eaDdlGyNg6eFqpY 20 MSBI Interview Questions : kzbin.info/www/bejne/hKjCpHt7gNOCi6c SQL Server Joins : kzbin.info/www/bejne/gYXZint7o9mppJo SQL Step by Step - kzbin.info/www/bejne/q3jPl4NvpJyeo7s Angular Step by Step Tutorial for Beginners : kzbin.info/www/bejne/Y2q5lIptgqd3qZo 25 Angular Interview Questions : kzbin.info/www/bejne/Y5vIoKx6f6mmia8 25 Important ASP.NET Interview Questions : kzbin.info/www/bejne/ponQfpejf7p2Zsk 35 Important JavaScript Interview Questions : kzbin.info/www/bejne/kJOXlYOfbKh0hLc 20 MySQL Interview Questions : kzbin.info/www/bejne/b5nJm3Zjd9WMaJI 5 MSBI Interview Questions : kzbin.info/www/bejne/a3abYmiXjaaqj7M 20 PHP Interview Questions : kzbin.info/www/bejne/Z5PTf4avo7qlopo
@digital.voyager
@digital.voyager 7 ай бұрын
C# 8.0 supports interface implementation methods, including default interface implementations, which allow you to add new members to a public interface without breaking existing implementers. I am little bit confused that why this change was made. @questpondvideos Could you please explain?
@anshulasri152
@anshulasri152 10 ай бұрын
Answer to a question asked at last "Difference between abstract class with all abstract methods and and Interface" is that although both are technically similar but at the time of multiple inheritence abstract class fails, for multiple inheritance we have to implement Interface only. Also I would like to thank you for the video that explains concepts so easily with code examples!
@adityapathak9999
@adityapathak9999 5 ай бұрын
What is the meaning of "abstract class fails"
@SHIVAML987
@SHIVAML987 5 ай бұрын
@@adityapathak9999 That means we will have a compile time error. So, technically if we need some implemented + some abstract method then only go ahead with abstract class, otherwise, interfaces.
@hassanadil3535
@hassanadil3535 Ай бұрын
That's true, but can't you go with multi level inheritance among classes and achieve the same.
@svb651
@svb651 Ай бұрын
23:54 The Answer can be yes I think because compile-time polymorphism is achieved through method overloading and operator overloading, which do not require inheritance
@nikhilkohirlyakaji
@nikhilkohirlyakaji 2 жыл бұрын
This video has cleared my biggest confusion related to Encapsulation vs abstraction which I have been facing for over 5 years now. Thanks
@dominiquez5643
@dominiquez5643 Жыл бұрын
Master class! Wow 20+ years developing and at last somebody explain things in a simple concrete manner! This is an amazing run down on OOP techniques properly exlained to be used and to answer questions from anybody in IT! Love this video!
@Anuj_sk
@Anuj_sk 4 ай бұрын
How can we inherit the properties of base class from derived class without declaring the object of base class in main() . Can you explain the backend architecture of inheritance Simple and very tough interview questions of Microsoft for 40 lakh per annum question.... Pata sabko hai pura gyan koi kabhi kisi ko nhi deta.... Bataiye
@jaym4358
@jaym4358 2 жыл бұрын
Wow. I did not even notice the 1 hour pass by. This is the best interview prep and the best video that explains OOP concepts by far! Thank you so much.
@jaym4358
@jaym4358 2 жыл бұрын
I had 3 technical interviews today. One of them had very heavy questions on OOP concepts. The interviewer loved my answer about what an interface is, and even admitted that he had a hard time grasping the concept earlier in his career. I passed that interview thanks to this video. I am moving on to the third and final round.
@Father_Of_Sudeera_Muthusinghe
@Father_Of_Sudeera_Muthusinghe 2 жыл бұрын
@@jaym4358 Congratulations!!!
@pranav288
@pranav288 2 жыл бұрын
@@jaym4358 How was the final round ?
@vedantkulkarni5437
@vedantkulkarni5437 Жыл бұрын
One suggestion to viewers....don't skip this video just because you are using different language other than cs....it is one of the best video for oop with proper explanation
@sridhargana155
@sridhargana155 2 жыл бұрын
An abstract class allows you to create functionality that subclasses can implement or override. An interface only allows you to define functionality, not implement it. And whereas a class can extend only one abstract class, it can take advantage of multiple interfaces.
@phelipepalte
@phelipepalte Жыл бұрын
Another difference between abstract class and interface is you can't do a dependency injection with abstract class..
@jestem-kses
@jestem-kses Жыл бұрын
Latest version of c# allow interfaces to provide default implementation
@bosegeorge1425
@bosegeorge1425 10 ай бұрын
​@@phelipepalte actually you can.
@abhishek.eswarappa
@abhishek.eswarappa 18 күн бұрын
Having attended loads of interviews as a c# developer, i can conclude this is the best OOPS tutorial in an interview perspective. Pure GEM.
@questpondvideos
@questpondvideos 18 күн бұрын
Really grateful for your feedback , thank you :)
@Father_Of_Sudeera_Muthusinghe
@Father_Of_Sudeera_Muthusinghe 2 жыл бұрын
One thing to notice... When we are talking about method "overriding vs overloading", we should emphasize that method overriding is a runtime polymorphism and method overloading is a compile-time polymorphism. I guess it will be an expected answer in an interview. Finally, thanks for this interview question video. It helps me a lot to gain self-confidence before going to interviews.
@shreyaspatil24
@shreyaspatil24 2 жыл бұрын
Yes. Also we should talk about method signatures.
@priyeshdubey40
@priyeshdubey40 2 жыл бұрын
but here is the catch he also told that without inheritance polymorphism will not work but you see overloading case which is example of compile time polymorphism is not following the inheritance thing ..I think he confused little bit.😉
@Father_Of_Sudeera_Muthusinghe
@Father_Of_Sudeera_Muthusinghe 2 жыл бұрын
@@priyeshdubey40 yup. U r right. In the comment section he has accepted the mistake. Anyway a great video.
@gazalkaintura2605
@gazalkaintura2605 Жыл бұрын
@@priyeshdubey40 exactly I thought the same thing
@vinothrajendran858
@vinothrajendran858 2 жыл бұрын
Sir, I have suggested your videos to nearly 20 people(my friends and colleagues) who were all trying for their next job and they found your videos really helpful. we are forever grateful. Thank you so much :) . And I will keep spreading your channel videos.
@danyahsan3958
@danyahsan3958 6 ай бұрын
did you get the job
@lavanyaguniganti1444
@lavanyaguniganti1444 2 жыл бұрын
Sir, I have cleared my interview in reputed MNC just by going through your interview videos. thank you so much
@rangababupolavarapu517
@rangababupolavarapu517 2 жыл бұрын
Do you have more interview questions
@questpondvideos
@questpondvideos 2 жыл бұрын
@@rangababupolavarapu517 you can visit www.questpond.com/interview-questions---answers-tutorial/cid63 for interview Q&A videos
@sunrise7442
@sunrise7442 2 жыл бұрын
Best video's ive ever came across that explains concepts so easy. I followed the questions and enrolled on Udemy for the extra questions not covered here, and Cleared my first interview after 15min post interviewing I was called by HR that I got the Job🎉🎉 kudos to you Sir.
@AashuKun
@AashuKun 2 ай бұрын
You explained the OOP concepts so clearly in just one hour, something my professor couldn't make me understand in four years! Thank you so much!
@mariahaamir171
@mariahaamir171 2 жыл бұрын
Its really underrated channel; I my opinion its by far the best. I am following Questpond since 7 years
@hemantvitthal3732
@hemantvitthal3732 2 жыл бұрын
Aftter many year (10 years) search on google or youtube, I found best programming concept, What I exactly needed. Thank you @Questpond.
@lekhrajawasthi8272
@lekhrajawasthi8272 11 ай бұрын
Thank you shiv sir for this easiest explanation. Answer to that last question is that : Abstract can't help in multiple inheritance but the Interface can do the multiple inheritance. So in case of any modification to the requirement one can easily modify interface by implementing multiple inheritance.
@stepbackandthink
@stepbackandthink Жыл бұрын
You have explained this far better than actual training videos.
@seijumimurasakibara5516
@seijumimurasakibara5516 8 ай бұрын
your dry wit coupled with your easy to understand explanations makes this video enjoyable to watch! thank you for this, i've finally understood the difference between abstraction and encapsulation and learned couple more things as well. Please keep up the good work!
@questpondvideos
@questpondvideos 8 ай бұрын
Thank You :)
@hassanadil3535
@hassanadil3535 Ай бұрын
Hi sir, referring to question # 21, you can actually write logic in an interface because C# 8 introduced 'Default Interface Methods' where you can write default logic for interface methods.
@omarcollazo5011
@omarcollazo5011 10 ай бұрын
This is the best explanation of abstraction vs encapsulation that I've ever heard. Thank you, sir!
@legendgattu
@legendgattu 2 жыл бұрын
Abstraction is exposing only whatever is necessary outside a class. Encapsulation is binding data and behaviour (methods) together.
@hirajabeen9681
@hirajabeen9681 7 ай бұрын
I am here to recall my concepts and I have seen lots of material pdfs , YT vids and consult with books as well but this video I must say is so accurate and totally concise and delivers exactly what anyone need ! Much Appreciation for you ! Hatts off to your Efforts ! More Power To You ! @Questpond
@questpondvideos
@questpondvideos 7 ай бұрын
Thank You 🙏
@unknownfacts1197
@unknownfacts1197 2 жыл бұрын
Multiple inheritance is what makes interface and abstract class differ from each other when they become technically similar
@questpondvideos
@questpondvideos 2 жыл бұрын
So right. Thats the only BIG technical difference
@unknownfacts1197
@unknownfacts1197 2 жыл бұрын
@@questpondvideos Thank you.. Your explanations are so good sir 👍
@automationselenium1331
@automationselenium1331 2 жыл бұрын
By far the best video on C# interview I have seen on youtube, how one hour passed I have no idea, your way of teaching is amazing and I can watch your videos for hours...thank you and god bless you.
@NiravPatel01
@NiravPatel01 Жыл бұрын
Question 11: can polymorphism work without inheritance? Yes for static polymorphism No for dynamic polymorphism
@swap2281997
@swap2281997 Жыл бұрын
Exactly!
@jankichalise904
@jankichalise904 8 ай бұрын
I always knew the theory part but when it comes to interview every interviewer was like what's the practical implementation of it and i really found the answer nowhere. thankyou so much for taking efforts and making an awesome video
@raoadnan442
@raoadnan442 2 жыл бұрын
Awesome way of describing. I have been searching OOP interview question answers but unable to find a great teacher like you. Hurrah.. now I have. Love from Pakistan. Keep doing this great job.
@Carbv1
@Carbv1 2 жыл бұрын
Thank you! I’m so glad you’re showing real time coding examples while explaining each necessary details. I’m learning a lot from this video. I can’t wait to watch your other videos! Thank you!!!
@suprabhat7582
@suprabhat7582 4 ай бұрын
I have cleared interview by referring your videos. Thank you.
@nalinikantadash8669
@nalinikantadash8669 Жыл бұрын
An Interface contains methods which are by default abstract.But as an abstract class is a partially defined parent class so there is a possibility that it can contain both abstract methods as well as non abstract methods.This is the basic difference between an interface and an abstract class.
@SSSALLJOBSPORTAL
@SSSALLJOBSPORTAL 9 ай бұрын
Wah!! What an explanation boss!! Crystal clear explanation... 🙌 really thank you🔥
@PabloMartinezfr
@PabloMartinezfr 2 жыл бұрын
Best OOPS Interview Questions and Answers on KZbin!
@EdisonSeas
@EdisonSeas Жыл бұрын
Great video, for understanding OOP concepts not just for C# but also any other language even if they don't support them, (like JavaScript). Pura vida!
@natnaelhabtamu2799
@natnaelhabtamu2799 2 жыл бұрын
THIS is GOLD, you can easily follow up with any OOP language. thanks sir 🤗
@panic_seller
@panic_seller Жыл бұрын
Very good video, never paid attention for 1 hour in a KZbin video
@kingfisher3791
@kingfisher3791 2 жыл бұрын
What most anyone can say about this video, it is really awesome. After seeing this i come to know what the purpose of oops concepts
@binayashrestha4131
@binayashrestha4131 2 жыл бұрын
Best OOP explanation video in KZbin !
@TyagiNushrat
@TyagiNushrat Ай бұрын
It helps me a lot to get refresh my knowledge after so many work experience, Thank you so much.🙂
@gopavarapuguruprasad
@gopavarapuguruprasad Жыл бұрын
One of best video about oops concepts interview question and answers I come across. Please keep up good work sir👍.
@naseerhussain5272
@naseerhussain5272 2 жыл бұрын
This is the Best Explanation one could have asked for
@udithaliyanage6375
@udithaliyanage6375 5 күн бұрын
23:59 Compile time polymorphism can be achieved without inheritance. As an example Method overloading and operator overloading.
@fernandod3510
@fernandod3510 2 жыл бұрын
You have a real talent for education and clear explanation. Thank you for all you have given.
@praveenrajubattula701
@praveenrajubattula701 2 жыл бұрын
Good video. Just 1 correction - interface can contain implementation, which was implemented in c#8.
@ShankarV-te7le
@ShankarV-te7le Жыл бұрын
Simply superb explanation...thank you @Questpond.
@shubhamgadre5796
@shubhamgadre5796 5 ай бұрын
//while creating/designing the functions/properties, I am actually implementing abstraction. //What needs to be shown to public and what to keep private is Abstraction. //The Designing process of the Employee class is Abstraction. //The implementation of Employee class is Encapsulation, as we have wrapped up all the functions in //Validate() method. //That's how encapsulation implements abstraction. Am I right?? Time. 13:25
@ankursahani8564
@ankursahani8564 2 жыл бұрын
Sir your explanation is very systematic. Sir please upload Question and answer for top 50 C programming coding Question for fresher interview.
@theintuitivetruth
@theintuitivetruth 2 жыл бұрын
For the answer to last query, Even though we write abstract class same as interface, but we cannot do multiple inheritance of the abstract class, whereas we can implement multiple interfaces.
@ryuzaki6865
@ryuzaki6865 2 жыл бұрын
Plus when we are implementing methods of an Interface we don't need to use the "override" keyword, whereas when we are implementing the abstract method of an abstract Class we need to use the "override" keyword.
@hassanadil3535
@hassanadil3535 Ай бұрын
Hi sir, referring to your question difference between abstract class and interfaces, the difference is abstract is actually used to write a complete process in which base process might be the same but the corresponding processes might be different and those will be implemented by the derived class for example, I am going to write a process for calculating gratuity for two types of employees permanent and contractual and 1 years gratuity for both of them are 100% net pay and 60% net pay respectively, now calculating gratuity is the purpose but these two implementations will be provided by the derived classes and will be invoked by the abstract class's method. Interface is a means for bounding a class to must have a couple of properties or methods.
@rajeshmacpant
@rajeshmacpant 2 жыл бұрын
Excellent. This is such an easy refresher or explanation of OOPS concepts.
@digital.voyager
@digital.voyager 7 ай бұрын
• An abstract class allows us to implement methods as well as make them abstract to be overridden by child classes. • Interface does not allow us to implement any method we can only define its signature. • Any class can inherit only one abstract class but it can inherit multiple interfaces. Although, C# 8.0 supports interface implementation methods, including default interface implementations, which allow you to add new members to a public interface without breaking existing implementers. I am little bit confused that why this change was made. @questpondvideos Could you please explain?
@10yearsago84
@10yearsago84 5 ай бұрын
Really a great set of questions. Thoroughly covered all the topics. Thank you sir :)
@AzeemRaavi
@AzeemRaavi 2 жыл бұрын
Awesome way to answers the OOP questions. Love from Pakistan 🇵🇰
@ahmadcomputeracademy7344
@ahmadcomputeracademy7344 Жыл бұрын
Parent class is also called super class or base class. Child class is also called derived class... Some interviewer asked this question. So I decided to comment here down for such amazing video.
@gametechtutorial4670
@gametechtutorial4670 2 жыл бұрын
Best video so far. Clear, right at the point. Im getting the point right away. Thank you for sharing the knowledge sir.😃🙇‍♂
@DuI41093
@DuI41093 10 ай бұрын
Sir answer to the final question is Multiple inheritance cannot be achieved using the Abstract class, but multiple inheritance can achieve using the Interface
@shubhampanwar7647
@shubhampanwar7647 2 жыл бұрын
very very detailed and good quality video. i watched till question 27
@AhmedAdel-xg1cm
@AhmedAdel-xg1cm Жыл бұрын
Very intuitive and clear explanation of the concepts , thanks a lot for sharing. hope u will make a video for solid principles
@husnainmazhar6739
@husnainmazhar6739 9 ай бұрын
amazing video,, cleared all the concepts.. Thanks
@vidyamahathi6057
@vidyamahathi6057 2 жыл бұрын
I got a job.I just watched this video for oops concepts 😁
@MrMcKnite
@MrMcKnite 2 ай бұрын
Happy for you mate
@trijay
@trijay 7 ай бұрын
For the last question here are my few cents, When abstract class have all abstract methods then what is the difference between abstract class and an interface? 1) Here abstract class inherit only one other class 2)Where as Interface can inherit multiple interfaces 3) Abstract classes can have properties and constructor 4)Interface cannot have any property or constructor Please correct me if I am wrong
@mohamedmusthafa1057
@mohamedmusthafa1057 Жыл бұрын
I find this Channel You saved My lot of time thanks ❤
@benedictmabanga5736
@benedictmabanga5736 2 жыл бұрын
Best explanations! Thank you for this🙏🙌
@MrRajatbhatt
@MrRajatbhatt 2 жыл бұрын
Sir as you have mentioned polymorphism can't be implemented without inheritance. However static polymorphism aka method overloading we can do it in the same class. So for me saying polymorphism can't be implemented without inheritance seems contradictory. Please advice
@questpondvideos
@questpondvideos 2 жыл бұрын
Yeah you caught me :-) and you are perfectly right. A object polymorphism ( Dynamic polymorphism) needs inheritance. Missed that word dynamic , thanks for correcting. Do send a message to shiv_koirala@yahoo.com , would like to give you 8 months of subscription on Questpond. Happy learning.
@aneeshrajr2418
@aneeshrajr2418 2 жыл бұрын
@@questpondvideos Thankyou Sir for make this clear....
@aneeshrajr2418
@aneeshrajr2418 2 жыл бұрын
👍
@shabanashaik2784
@shabanashaik2784 2 жыл бұрын
@@questpondvideos can I also get it?? I too had the same doubt and checked the comments and i found this...
@judycariaga3945
@judycariaga3945 2 жыл бұрын
You really great at explaining it. Now I understand the OOP more. Thank you so much. ♥️
@sadakagaja
@sadakagaja 2 жыл бұрын
Awesome sir It helping me to learn C#❤️
@sandeepsingh3588
@sandeepsingh3588 5 ай бұрын
i think in abstarction there should be one thing should be mentioned like it can be achived by abstract class and interface while in encapsulation it can be achived by access modifiers and also they both have hide complexity but abstraction managed it as high level and encapsulation do it in low level
@shivamsoni4215
@shivamsoni4215 Жыл бұрын
Thank you for making simple topic complicated ♥
@keshavt6982
@keshavt6982 3 ай бұрын
Keep up the great work. Explanation was super easy to understand
@reshmabegampathan395
@reshmabegampathan395 2 жыл бұрын
Thank you for sharing these with us with practical. Really. We can grasp easily with practical. My ans to ur question: In abstract class, there is non abstract methods also so we don’t have to implement that, only we need to implement abstract methods but in interface, all things we need to implement forcefully. Please tell me this is right or wrong. Once again, thank you so much. Keep going.
@vaibhavraj581
@vaibhavraj581 2 жыл бұрын
Very intuitive and clear explanation of the concepts , thanks a lot for sharing. Looking forward to learn more from your videos.
@Devdumplings
@Devdumplings 2 жыл бұрын
This is the best one compared any oops languages. Having come from a different language background finally I understood what exactly the concepts clearly and thanks for being realistic about the preparation importance as I was a unprepared hero 😂
@saravanansangeetha1206
@saravanansangeetha1206 2 жыл бұрын
Very very useful video for us, appreciate your efforts
@manpreet.mg16
@manpreet.mg16 2 жыл бұрын
You have done great video short and ans to remember in easiest way
@cjimenez2581
@cjimenez2581 Жыл бұрын
in Q11: I can implement it using interfaces... This is java, but I guess we can do the same on c# interface Shape { void draw(); } class Circle implements Shape { @Override public void draw() { System.out.println("Drawing a circle"); } } class Square implements Shape { @Override public void draw() { System.out.println("Drawing a square"); } } public class Main { public static void main(String[] args) { Shape circle = new Circle(); Shape square = new Square(); drawShape(circle); drawShape(square); } public static void drawShape(Shape shape) { shape.draw(); } }
@aumganeshbhaihadiyal5168
@aumganeshbhaihadiyal5168 Ай бұрын
2 main differences between Abstract class and Interface 1. Abstract class can have a default constructor Interface cant have constructors 2. Abstract class cant achieve multiple inheritance Interface can achieve multiple inheritance
@akashgupta2971
@akashgupta2971 2 жыл бұрын
Huge respect for the efforts and time that you and your team have put, the sequence of the questions were very connecting and gradual... Now I have a better concept after watching the video... And for the question you asked at the end of the video... My answer is that abstract classes can be partially or not implemented whereas interfaces should be fully implemented.
@yosiosibemekun2785
@yosiosibemekun2785 2 жыл бұрын
An interface only allows you to define functionality, not implement it.
@akashgupta2971
@akashgupta2971 2 жыл бұрын
@@yosiosibemekun2785 yeah that's another difference
@nithunandhugaming6519
@nithunandhugaming6519 8 ай бұрын
No one cant explain this much easier in overriding and virtual keyword concepts
@shivangisingh9920
@shivangisingh9920 2 жыл бұрын
You are awesome... Helped me a lot in the interview.
@deepz513
@deepz513 2 жыл бұрын
thank you sir, along with deeply explaining the concepts you are valuable advised is much appriciated.
@godwinchalz4863
@godwinchalz4863 Жыл бұрын
best video for oops in C#
@phanirao2008
@phanirao2008 2 жыл бұрын
wonderful, very crispy, specially example taken easy than domian specific
@MilindKTechnology
@MilindKTechnology Жыл бұрын
24:38 Inheritance is not must for polymorphism as you can implement static polymorphism without inheritance. Please let me know sir if you had a different mean.
@CALLMEMANISH82
@CALLMEMANISH82 9 ай бұрын
thanks, very beneficial video to revise oop concepts.
@yogeshindurkar2981
@yogeshindurkar2981 Жыл бұрын
Q. 11 Can polymorphism work without inheritance. Ans : Yes Static polymorphism is also a polymorphism and it can be achieve without inheritance. Please correct me if I am wrong.
@yogeshkumar_29
@yogeshkumar_29 Жыл бұрын
You are Best Sir !! Really very helpful
@avantikamishra7586
@avantikamishra7586 2 жыл бұрын
hi explanation is awesome and you did great efforts in compiling all stuff in one place. Thanks please provide ebook of questions
@manjuanoop7239
@manjuanoop7239 Жыл бұрын
Excellent material thanks for sharing such an informative video👍🏻
@izmar47
@izmar47 Жыл бұрын
Thank you for the lesson. I can't tell you how much this helped. I appreciate your effort. Liked and Subscribed!
@hiteshdogra3047
@hiteshdogra3047 2 жыл бұрын
In response to your question "How an Abstract Class with all abstract functions is different from and Interface?", I guess Even if Abstract class has all the functions defined as abstract, the child class is not forced to override (Or provide functionality of) the abstract functions. Whereas in case of Interface implementation the implementing class has to provide all the implementations of all the functions. Am I correct?
@MarkRyanAlot
@MarkRyanAlot 2 жыл бұрын
You're right. One key difference between the two is that an interface can only have public properties and methods, while an abstract class is the same as a regular class that can have variables, properties, and implemented methods using different access modifiers. An abstract class can have both abstract and virtual methods. Also, if you want to leverage IOC you will be using interfaces instead of abstract classes.
@anysdev
@anysdev 2 жыл бұрын
This is not correct. You must implement the functionality for abstract methods just as you would with the interface methods so as far as implementation requirements go there is no difference (note that he marked them as abstract methods, not virtual methods, so they must be overridden). The main difference in that situation is simply that a class can only inherit from a single abstract class but can implement multiple interfaces. Conceptually you can figure out when to use which one. For example if you have a Cat class and a Dog class, it makes sense for them to inherit from an abstract Animal class because both of them are actually animals and all animals will have some shared functionality like breathing. However a ClimbsTrees abstract class wouldn't really make sense, it's more of an indication of what some animals can do rather than what they are, so in this case you can use an IClimbTrees interface and apply it to any animals that can climb trees. Now the dog doesn't need to care about anything to do with climbing trees but the cat can inherit the interface and add the functionality.
@abdulhai_007
@abdulhai_007 Жыл бұрын
No bro, U can't have definition of abstract method within abstract class. U can just simply DECLARE(not Define) a method as abstract method. But yes, if u want to define(means,give implementation) a method within abstract class, u need to make it as virtual, And in that case it's not mandatory to override it by its child class.
@priyeshdubey40
@priyeshdubey40 2 жыл бұрын
You told that without inheritance polymorphism will not work but you need to see overloading case which is example of compile time polymorphism which is not following the inheritance thing ..
@abdullahahmed8468
@abdullahahmed8468 2 жыл бұрын
amazing content with clear and simple answers, Thanks alot
@CodingPathshalaa
@CodingPathshalaa 5 ай бұрын
Sir at 24:35 you said for polymorphism inheritance is must , but since we do overloading in only one class , we dont need inheritance for Static polymorphism.
@akshaysoren5400
@akshaysoren5400 Жыл бұрын
Thank you so much sir. i really like the way you explain.
@sanobarmemon1113
@sanobarmemon1113 2 ай бұрын
Method overloading can be achieved without inheritance. Hence polymorphism can be implemented without inheritance.
@justiceeziefule9308
@justiceeziefule9308 Жыл бұрын
This is well explained. Thank you bro
@kishanpatel6657
@kishanpatel6657 Жыл бұрын
Very good point to point.
@praphulshresth
@praphulshresth Жыл бұрын
Excellent work guru ji, maja hi aa gya. or videos banayeeye python par
@nagaboddu852
@nagaboddu852 6 ай бұрын
Thank you sir , it’s very useful 😊
@priyanshu4016
@priyanshu4016 2 жыл бұрын
last question ans: we can implement the multiple inheritances using interface but not with an abstract class that make difference between abstract class with all abreact method and interface. Please correct me if my understanding is wrong sir.
HELP!!!
00:46
Natan por Aí
Рет қаралды 77 МЛН
How Much Tape To Stop A Lamborghini?
00:15
MrBeast
Рет қаралды 206 МЛН
Object-Oriented Programming is Bad
44:35
Brian Will
Рет қаралды 2,3 МЛН
Object Oriented Programming (OOP) in C++ Course
1:30:26
freeCodeCamp.org
Рет қаралды 2,6 МЛН
Learn Java Object-Oriented Programming (with actual code)
29:44
ForrestKnight
Рет қаралды 36 М.
What is SRE | Tasks and Responsibilities of an SRE | SRE vs DevOps
24:25
TechWorld with Nana
Рет қаралды 336 М.
HELP!!!
00:46
Natan por Aí
Рет қаралды 77 МЛН