Is it possible to create constructor for an Abstract class?
29 April 2010
215 views
No Comment
Yes, its possible to create constructors for Abstract classes. We can create Private, Public and Protected constructors for Abstract classes
Example:
Abstract class myAbstClass
{
public myAbstClass()
{ }
private myAbstClass(int x)
{ //some implementation }
protected myAbstClass(string strX, string strY, int x)
{ //some implementation }
}
Popularity: 25% [?]
Related interview questions
- How can I create a Singleton class by using public constructor?
- What is differance between Abstract and Interface
- How do you inherit from a class in c#?
- What are the good practices to use while designing for reuse
- Can I inherit two difference classes to partial classes?











Leave your response!
You must be logged in to post a comment.