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
List down the different ide’s provided by microsoft for c# development.
Where do I put dll files?
What is static variable in c#?
What Is A Satellite Assembly?
What are the 2 kinds of data type conversions in c#?
Can namespace contain the private class?
Explain About Global.asax
What is a delegate how is it type safe?
How do I create a multilanguage, single-file assembly?
If the interface in c# only contains the declaration of the methods and we need to define those methods in the class, then why we use the interface?
Explain the working of serialization?
What is generic delegate in c#?
What are generics in c#.net?
What is a .exe extension files? How is it similar to .dll extension files?
what is the Difference between the public and private ?