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 does exclamation mark mean c#?
Explain how can I get around scope problems in a try/catch?
How main method is called in c#?
What is a method signature in c#?
What is access modifier in c#?
Why we use oops in c#?
What is var c#?
What is event and delegates in c#?
Which is executed if an exception has not occurred?
What is writeline in c#?
What is generic delegates in c#?
Can you see a loop recorder?
Why is ienumerable used?
What is difference between ilist and list?
What are abstract classes in c#?