I am completely blown away by the quality of information found in all your videos. I have watched many of your videos and I always learn so much. You are a blessed educator. Please do not stop you have found your calling in life!!!
Thank you very much for taking time to give feedback. In the description of this video, I have included the link for ASP .NET, C#, and SQL Server playlists. All the videos are arranged in logical sequence in these playlists, which could be useful to you. Please share the link with your friends who you think would also benefit from them. If you like these videos, please click on the THUMBS UP button below the video. For email alerts, when new videos are uploaded, you may subscribe to my channel.
Your explanations are extremely easy to understand. I am doing a Pluralsight course on C# and whenever I don't understand any concept there, I listen to your video(on that particular topic) and it CLICKS!! Thanks a bunch for these videos and for being an tremendous tutor
I came across your videos yesterday and since then i am really blown away. You are such a great Teacher, this channel is the best one. God bless you for your work 😊
Not really, interfaces can only have declarations and not implementations, where as abstract classes can have implementations as well as abstract members (just member declarations without implementations)
Hi, Venkat Sir, Thanks for providing such type of video tutorials. Really awesome for new start!! Even few videos are helpful for experienced people as well to make transparent their concepts...
Hi Akash, if you use virtual methods, you will have to provide a default implementation. However, there may be cases, where we don't want to provide any default implementation. This is one example where we prefer an abstract class with an abstract method. Please let me know, if this answers your question?
Hi kudvenkat sir, you are great loved you videos . I have a doubt, you have mentioned that if you dont wish to implement a method in inherted class you can mark the class as abstract but dont you think it contradicts the statement that abstracted classes are only used as base class, because if you mark inherited class as abstract than it becomes derived class.
Hi sir I would really thank you for giving us these videos .These are very helpful to me. I did not understand Why we go for this abstract classes ???..Please help me Thank you soo much sir
Hi Swathi, Please check Part 3 in C# Interview Questions and Answers video series. I hope this video answers. Part 3 Why and when should we use an abstract class
Thanks Sir.Yes it helped me a lot.I am again really thankful to you,these tutorials has helped me a lot.Facing interviews with no difficulty.Thanks venkat sir. Regards
This video was great!! :D I just read about abstract classes in a C# book that I have and i kind of understood it but after watching your video I now get it :D
excellent and expertly covered. but at the slide u said that in next u will discuss where to use abstract class but i cant find that topic because next topic is about difference between abstract class and interface and also i cant find the intro of interface. plz guide.
Hey venkat,First of all thanks alot,your videos has really boosted up my confidence,i m facing my interviews without any hesitation these days.Thanks again.I had faced a question in my recent interview,which was "why exactly we needed Abstract class when same thing can be done by having virtual keyword in base class and override keyword in derived class"?i m really struck here.Why abstract class?Do help me venkat sir will be thankful to you. Regards
You are such a good teacher like the best i know thank you so much for your support i have been watching your videos from the start and i know everything up to now thank you :D :D :P
You can not create an object from an abstract class, but you can you use the static non abstract methods by calling classname.method() because there is implementation if the method itself is not abstract.
Why do we need to use "override" keyword in the method signature while implementing method of an Abstract Class although we didn't use "override" keyword while we were implementing method of an Interface? Please reply!
HI sir, You mentioned that we can write a non-abstract function in abstract class definition. But what is the use of it as we can not create object of Abstract class. means we can not use that function at all? and Thank you for detail explanation :-)
Well you can use a static modifier for that non-abstract function. This way, you can call it from within another class.That's one use. Second, if you didn't want the sub-classes to inherit a function, it can be marked as non-abstract. Only all the abstract members must be implemented by the sub-classes.
On my visual studio when I have my program like you do at 8:37 , it tells me my print method must be marked as abstract or it gives an error on the program class print method can you tell me why its VS 2015
You said an ab class can only be used as a base class... But earlier in the same video you said If u don't want 2 provide implementation 4 all ab members of an ab class then the class inheriting the ab class can be marked as 'abstract'. So this 2nd abstract class becomes a child class and contradicts with your statement right? Please reply.
Jithin John only abstract class cannot have implementation whereas he removed the abstract key word int the method and made the implementation so if he used abstract key word in the method he can not have implementation
sir is it possible inherit sealed class? I heard that we can inherit sealed class by using extension method. i researched in web i didnt got proper answer pl can u help me with an example...!
Where can abstract class used in realtime projects, and what is difference between encapsulation and abstraction with an example is is asked interview but I didn't get proper answer. Please if possible provide answer. Thank you.
Hey Satish - Please checkout the following video, which explains when to use an abstract class in real world. ruclips.net/video/yyU3bXyc_oU/видео.html&index=4 The following video can help, if you want to become a full stack web developer ruclips.net/video/RiKcSDbGVXw/видео.html
You said a class cannot be sealed and abstract at the same time. But static class in c# is internally sealed and abstarct. It creates confusion . Kindly clearify.
sir, how to achieve abstraction and encapsulation in c#.i know show only necessary details to user is called abstraction and hide unnecessary details is called encapsulation. but how to achieve by programming..
This is great question Ranweer. We use properties and methods to achieve encapsulation. The concept of Abstraction is a bit more abstract. For example, in a real world when we think about an employee of a company, there are many things to consider, like first name, last name, date of birth, gender, city of birth, country, department, experience, skills, married, graduate or post graduate, etc.....Are all these relevant to the application that you are developing. Include only those properties in your class design that are relevant to your application. This is abstraction. I will try to record and upload a video very soon on both these concepts. Hope this helps.
using System; namespace AbstractExample { //Using abstract keyword to declare abstract class. //Abstract class cannot be Sealed but can be used as public,protected etc. //Abstract class need to base class. //Abstract class is incomplete class that mean you cannot instantiate class and its member. public abstract class Customer { //Method declare inside abstract class can be defined as abstract or without //If it is abstract then its body should not be defined inside abstract class if do we will get error. //Abstract Method- cannot declare body of this method public abstract void Print(); //Non Abstract method- Body need to be declared public void Paste() { Console.WriteLine("Paste method is called"); } } //Program class is Non-abstract //If the program class is inheriting from abstract class then it have two options //a) We can declare the class abstract i.e Program class to be declared as abstract //b) Implementation of the abstract method in our case print() public class Program : Customer { // Use override keyword for implementing print method // We must have to use Print method since it is in abstract. public override void Print() { Console.WriteLine("Print method is called"); } public static void Main(string[] args) { Customer C = new Program(); C.Print(); C.Paste(); //Program P = new Program(); //P.Print(); //P.Paste(); } } }
Good question Abhinav - Abstract class by definition can only be used as a base (parent) class. This means an abstract class reference variable can still point to derived class instances and through this we will be able to invoke both abstract and non-abstract members. Hope this answers your question. Great question. Thank you for asking.
An abstract function does not have a body An abstract class can not be instantiated An abstract class can only be used as a Base Class(Inheritance) The child class has to provide the implementation for all the abstract members, otherwise you get an error. To provide the implementation in the child class you have to use the keyword: !! override !! If the child class is also abstract it doesnt have to implement the abstract members of the Base Class.
I understand what interfaces and abstract classes are now ( they seem pretty similar so far, but the next video is on the difference between the two., so I'll probably get my answers there).. but, what is their use.. so far it only seems like you're writing some extra lines of code for no good reason!
ChildClass C = new ChildClass() C.callMethodVirtual(); or BaseClass B = new ChildClass(); B.callMethodVirtual(); But this can not be done BaseClass B = new BaseClass(); B.callMethodVirtual(); A sealed member can only be used in the Base class, can not be used in the Derived class. So an abstract sealed member is impossible. IF a class contains non-abstract variables and functions it can NOT be instantiated, it still has to be inherited by another class(I hate ABSTRACT)
You typically use an abstract class when you have some set of common functionality to be shared between derived classes. That is, you cannot use an interface because you want to provide some default functionality
I am completely blown away by the quality of information found in all your videos. I have watched many of your videos and I always learn so much. You are a blessed educator. Please do not stop you have found your calling in life!!!
AGREED
Thank you very much for taking time to give feedback. In the description of this video, I have included the link for ASP .NET, C#, and SQL Server playlists. All the videos are arranged in logical sequence in these playlists, which could be useful to you. Please share the link with your friends who you think would also benefit from them. If you like these videos, please click on the THUMBS UP button below the video. For email alerts, when new videos are uploaded, you may subscribe to my channel.
After years, still your videos are the best and most clear explanations. Truly appreciated.
Your explanations are extremely easy to understand. I am doing a Pluralsight course on C# and whenever I don't understand any concept there, I listen to your video(on that particular topic) and it CLICKS!! Thanks a bunch for these videos and for being an tremendous tutor
I came across your videos yesterday and since then i am really blown away. You are such a great Teacher, this channel is the best one. God bless you for your work 😊
Not really, interfaces can only have declarations and not implementations, where as abstract classes can have implementations as well as abstract members (just member declarations without implementations)
Hi, Venkat Sir, Thanks for providing such type of video tutorials. Really awesome for new start!! Even few videos are helpful for experienced people as well to make transparent their concepts...
Thank you to the moon and back, this helped me to pass my exam!!
actually he is saying in every video like we will take about access modifier in latter videos but we understand the meaning very tremendous job!!!!!
Venkat, you are a blessing for new comers to c#. Thank you so much.
Very gud Venkat sir.......I don't have enough word to describe your excellent teaching skills......your videos are really helpful.
this can't be more better ,its already a very good resource
as always....
you are an artist
Best explanation for the Abstract class i have came across
Hi Akash, if you use virtual methods, you will have to provide a default implementation. However, there may be cases, where we don't want to provide any default implementation. This is one example where we prefer an abstract class with an abstract method. Please let me know, if this answers your question?
thank you for these amazing video, they are really the best i have ever seen :)
Best tutorials on c# amazing content ❤️
At the moment, I am in London
I've had the best knowledge ever thanks 😊
I love venkats tutorials. Sir you explain amazing. If I was interviewing my first question to the candidate would be DO YOU KNOW VENKAT?
Hi kudvenkat sir, you are great loved you videos . I have a doubt, you have mentioned that if you dont wish to implement a method in inherted class you can mark the class as abstract but dont you think it contradicts the statement that abstracted classes are only used as base class, because if you mark inherited class as abstract than it becomes derived class.
That was very useful. I was really confused about abstract class now I feel much better about them
Hi sir
I would really thank you for giving us these videos .These are very helpful to me.
I did not understand Why we go for this abstract classes ???..Please help me
Thank you soo much sir
Hi Swathi, Please check Part 3 in C# Interview Questions and Answers video series. I hope this video answers.
Part 3 Why and when should we use an abstract class
Thank you soo much for taking time to give me reply sir...It helps me a lot....
Very Good Videos
kudvenkat Nice Videos
Still You are Confused In Abstract Classes??
Thank you sir. Really nice video about explicit interface implementation... Its very interesting ha ha ha........
Thank you so much Bro,,You are the best so far...I am praying for you....Thanks...
Thanks Sir.Yes it helped me a lot.I am again really thankful to you,these tutorials has helped me a lot.Facing interviews with no difficulty.Thanks venkat sir.
Regards
This video was great!! :D I just read about abstract classes in a C# book that I have and i kind of understood it but after watching your video I now get it :D
Nice Video Mr. Venkat.
excellent and expertly covered. but at the slide u said that in next u will discuss where to use abstract class but i cant find that topic because next topic is about difference between abstract class and interface and also i cant find the intro of interface. plz guide.
Hey venkat,First of all thanks alot,your videos has really boosted up my confidence,i m facing my interviews without any hesitation these days.Thanks again.I had faced a question in my recent interview,which was "why exactly we needed Abstract class when same thing can be done by having virtual keyword in base class and override keyword in derived class"?i m really struck here.Why abstract class?Do help me venkat sir will be thankful to you.
Regards
good lesson,if the audio be more clear,that will be perfect.
the best teacher at all
Can't wait till you get to the point where you explain what's the use of interfaces and abstract classes.
You are such a good teacher like the best i know thank you so much for your support i have been watching your videos from the start and i know everything up to now thank you :D :D :P
You can not create an object from an abstract class, but you can you use the static non abstract methods by calling classname.method() because there is implementation if the method itself is not abstract.
Hi venkat your C# all videos are nice...good job..
very useful videos. Thank you.
Interesting Tutorial.
Excellent...
Nice!
thanks a lot...ur videos are really helpful..
really very nice ...
Thank You very much Sir.
Nice....
hi kudvenkat
Could you please make Java tutorials. Thanks
Which mouse enhancer do u use tat creates a temp circle on click?
Why do we need to use "override" keyword in the method signature while implementing method of an Abstract Class although we didn't use "override" keyword while we were implementing method of an Interface?
Please reply!
Thank you Sir
HI sir, You mentioned that we can write a non-abstract function in abstract class definition. But what is the use of it as we can not create object of Abstract class. means we can not use that function at all? and Thank you for detail explanation :-)
Well you can use a static modifier for that non-abstract function. This way, you can call it from within another class.That's one use.
Second, if you didn't want the sub-classes to inherit a function, it can be marked as non-abstract. Only all the abstract members must be implemented by the sub-classes.
Please correct me if i am wrong, but abstract class has functionality of both abstract and interfaces.
On my visual studio when I have my program like you do at 8:37 , it tells me my print method must be marked as abstract or it gives an error on the program class print method can you tell me why its VS 2015
thank you very much
i have a list of cards(abstract class) and i want to get the value of a property thats only in a subclass called fighter card how can i do that?
You have a gift.
Thank you sir - you said that abstract classes are classes that use the "abstract" keyword. All well and good, but what is an abstract class?
Andrew Wiggins An abstract is used as a base for other classes. It's a "template" for a class--almost like a "class" version of an "interface".
You said an ab class can only be used as a base class... But earlier in the same video you said If u don't want 2 provide implementation 4 all ab members of an ab class then the class inheriting the ab class can be marked as 'abstract'. So this 2nd abstract class becomes a child class and contradicts with your statement right? Please reply.
Jithin John only abstract class cannot have implementation whereas he removed the abstract key word int the method and made the implementation so if he used abstract key word in the method he can not have implementation
A parent or child class, abstract class only be used as a base class for other classes...
sir is it possible inherit sealed class?
I heard that we can inherit sealed class by using extension method. i researched in web i didnt got proper answer pl can u help me with an example...!
I learn from the first video to part32 this one rn now, they are good and ez to understand, but I have no idea what can I do ......
Where can abstract class used in realtime projects, and what is difference between encapsulation and abstraction with an example is is asked interview but I didn't get proper answer. Please if possible provide answer. Thank you.
Hey Satish - Please checkout the following video, which explains when to use an abstract class in real world.
ruclips.net/video/yyU3bXyc_oU/видео.html&index=4
The following video can help, if you want to become a full stack web developer
ruclips.net/video/RiKcSDbGVXw/видео.html
This abstract classes will supports the concepts of multiple inheritance(i.e) child class :base1 class,base2 class .like interface
If an abstract class can only be used as base class then why the derived class marked as abstract if class does not wish to provide implementation.
Thank you soo much
You said a class cannot be sealed and abstract at the same time. But static class in c# is internally sealed and abstarct. It creates confusion . Kindly clearify.
isnt he contradicting whats written on the video at 9.24... I'm confused :(
Temel .. yes , if audience had observed.. he meant to say abstract instead of Non-Abstract!
Also an abstract method cannot be hidden whereas interface method can.
this is good videos
Very Good Videos
jbhaskar v Thanks
Thank you
sir, how to achieve abstraction and encapsulation in c#.i know show only necessary details to user is called abstraction and hide unnecessary details is called encapsulation. but how to achieve by programming..
This is great question Ranweer. We use properties and methods to achieve encapsulation. The concept of Abstraction is a bit more abstract. For example, in a real world when we think about an employee of a company, there are many things to consider, like first name, last name, date of birth, gender, city of birth, country, department, experience, skills, married, graduate or post graduate, etc.....Are all these relevant to the application that you are developing. Include only those properties in your class design that are relevant to your application. This is abstraction. I will try to record and upload a video very soon on both these concepts. Hope this helps.
Thank u sir for your guidance.Please upload video for more clarification.
A mandatory interview question
What is the difference bet J2SE and C#?
sir can u provide ur lec for other sub also ??
using System;
namespace AbstractExample
{
//Using abstract keyword to declare abstract class.
//Abstract class cannot be Sealed but can be used as public,protected etc.
//Abstract class need to base class.
//Abstract class is incomplete class that mean you cannot instantiate class and its member.
public abstract class Customer
{
//Method declare inside abstract class can be defined as abstract or without
//If it is abstract then its body should not be defined inside abstract class if do we will get error.
//Abstract Method- cannot declare body of this method
public abstract void Print();
//Non Abstract method- Body need to be declared
public void Paste()
{
Console.WriteLine("Paste method is called");
}
}
//Program class is Non-abstract
//If the program class is inheriting from abstract class then it have two options
//a) We can declare the class abstract i.e Program class to be declared as abstract
//b) Implementation of the abstract method in our case print()
public class Program : Customer
{
// Use override keyword for implementing print method
// We must have to use Print method since it is in abstract.
public override void Print()
{
Console.WriteLine("Print method is called");
}
public static void Main(string[] args)
{
Customer C = new Program();
C.Print();
C.Paste();
//Program P = new Program();
//P.Print();
//P.Paste();
}
}
}
Since we cannot instantiate Abstract class then, how can we access non abstract members present inside Abstract class?
Good question Abhinav - Abstract class by definition can only be used as a base (parent) class. This means an abstract class reference variable can still point to derived class instances and through this we will be able to invoke both abstract and non-abstract members. Hope this answers your question. Great question. Thank you for asking.
@@Csharp-video-tutorialsBlogspot Many thanks for clearing my doubt. I'm following your blogs since 2012 and it has helped me a lot in my career.
Do you live in india?
An abstract function does not have a body
An abstract class can not be instantiated
An abstract class can only be used as a Base Class(Inheritance)
The child class has to provide the implementation for all the abstract members, otherwise you get an error.
To provide the implementation in the child class you have to use the keyword: !! override !!
If the child class is also abstract it doesnt have to implement the abstract members of the Base Class.
I understand what interfaces and abstract classes are now ( they seem pretty similar so far, but the next video is on the difference between the two., so I'll probably get my answers there).. but, what is their use.. so far it only seems like you're writing some extra lines of code for no good reason!
why abstract class can't be initialized
What this video of venkat's : ruclips.net/video/yyU3bXyc_oU/видео.html
ChildClass C = new ChildClass()
C.callMethodVirtual();
or BaseClass B = new ChildClass();
B.callMethodVirtual();
But this can not be done
BaseClass B = new BaseClass();
B.callMethodVirtual();
A sealed member can only be used in the Base class, can not be used in the Derived class.
So an abstract sealed member is impossible.
IF a class contains non-abstract variables and functions it can NOT be instantiated, it still has to be inherited by another class(I hate ABSTRACT)
can anyone tell me in detail why abstract class can't be initialized???
You typically use an abstract class when you have some set of common
functionality to be shared between derived classes. That is, you cannot
use an interface because you want to provide some default functionality
because abstract class composed of incomplete method meaning no implementation so it does not make sense if you instantiate abstract class.
Worst sound quality videos
Thank you sir