Abstract Class

0%

Is there any error in the below code?
public class SuperClass
{
protected abstract void Print();
}

Correct! Wrong!

If a class contains an abstract method in a class, then

Correct! Wrong!

What is output of the following program?
class Program
{
static void Main()
{
Car car = new Car();
car.Print();
Console.ReadLine();
}
}

public abstract class Car
{
public void Print()
{
Console.WriteLine("CAR Print");
}
}

Correct! Wrong!

We can declare abstract method as static in Abstract class?

Correct! Wrong!

Is there any problem in below code class?
public abstract class Car
{
public void Print()
{
Console.WriteLine("CAR Print");
}

public abstract void TakeTest()
{
Console.WriteLine("Take Test Drive");
}
}

Correct! Wrong!

Is there any problem in below code class?
public abstract class Car
{
public void Print()
{
Console.WriteLine("CAR Print");
}

abstract void TakeTest();

}

Correct! Wrong!

Abstract class can contain constructor

Correct! Wrong!

Is there any problem in below code class?
public abstract class Car
{
public int Test = 10;

public void Print()
{
Console.WriteLine("CAR Print");
}
}

Correct! Wrong!

Is it necessary to have abstract method in abstract class?

Correct! Wrong!

What is the output of below code?
class Program
{
static void Main()
{
SuperClass childClass = new ChildClass();
childClass.Print();
Console.ReadLine();
}
}

public abstract class SuperClass
{
public virtual void Print()
{
Console.WriteLine("SuperClass Print");
}
}

public class ChildClass : SuperClass
{
public override void Print()
{
Console.WriteLine("ChildClass Print");
}
}

Correct! Wrong!

Abstract Class
Result
Beginner!
You need to work hard, read more about Abstract Class
Intermediator !
You are good but there is work to be done, read more about Abstract Class
Result
Pro !
You are excellent, read more about Abstract Class

Leave a Reply

Your email address will not be published. Required fields are marked *