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 the concept of strong names?
What is overriding in c#?
What are fields in c#?
How to use delegates with events?
Is null in c#?
What are the steps to make an assembly to public?
What is cls, cts and clr in net?
Is there an equivalent to the instanceof operator in visual j++?
Describe an abstract class?
What is the delegate in c#?
Can a method return multiple values in c#?
What is the function of .IsDescendent()?
Explain the OOPS concept in C#?
Define Final Class in C#
Explain the difference between “constant” and “read-only” variables used in c#?