Can we create instance for Abstract class?
Answer Posted / anand kumar dwivedi (bholu)
we can't create instance for an abstract class directly, but
with the help of DYNAMIC BINDING(in this case we can put the
ref. of parent class) we can create the object of abstract
class.
an example;
abstract class Temp
{
abstract void show();
void display()
{
System.out.println("possible to create");
}
}
class TestTemp extends Temp
{
void show()
{
System.out.println("we are providing body for abstract method");
}
public static void main(String[] args)
{
Temp temp = new TestTemp();
temp.show();
temp.display();
}
}
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is c# commonly used for?
What is session and cookies in c#?
What is the difference between virtual and override in c#?
What is data set in c#?
What is the difference between a field and a property in c#?
Explain the difference between class and interface in .net?
Why is aws serverless?
What is the meaning of MSIL?
What is arraylist c#?
How to use session under class file of APP_Code folder?
What is the difference between dynamic type variables and object type variables in c#?
Define satellite Assembly in .NET?
How long can a string be c#?
Explain the concepts of cts and cls(common language specification).
What is deadlock in c#?