Doubt 3 - What is the use of abstract class?Please give me exact answer?

Posted by Arjunan_Csharp under C# on 1/18/2013 | Points: 10 | Views : 1310 | Status : [Member] | Replies : 1
What is the use of abstract class?Please give me exact answer?

abstract Class:
1.we can't create an instance for the abstract class.
2.abstract class contains abstract methods and concrete methods.
3.Cannot declare abstract class as sealed.
4.a class which derived from abstract class must override all methods of abstract class.

This is what i said in interview.He asked one more question from the first point.we can't create an instance for that class then what is the use of that one?Why do i have to declare a method in abstract class.




Responses

Posted by: Saratvaddilli on: 1/18/2013 [Member] [MVP] Bronze | Points: 25

Up
0
Down
1)The purpose of an abstract class is to provide a common definition of a base class that multiple derived classes can share
2)yes abstract methods can have abstract and non-abstract method
3)we can't declare them sealed because : abstract classes will be derived and derived classes will provide the defination for the methods
4)yes, same like as interfaces ...

let me kknow if they are any furthur questions

Thanks and Regards
V.SaratChand
Show difficulties that how difficult you are

Arjunan_Csharp, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response