can we create instance of an abstract class?

 Posted by Rajni.Shekhar on 4/9/2012 | Category: C# Interview questions | Views: 1898 | Points: 40
Answer:

No, we can not create instance of an abstract class.

Example:

abstract class abstractExample{

public abstract void func1();
}

class derivedClass : abstractExample
{
public override void func1(){
//your code here.....
}
}


if you will try to create instance, it will give error.

abstractExample objAbstract=new abstractExample();//error in this line.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response