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


Please Help Members By Posting Answers For Below Questions

List down the different ide’s provided by microsoft for c# development.

468


Where do I put dll files?

560


What is static variable in c#?

483


What Is A Satellite Assembly?

533


What are the 2 kinds of data type conversions in c#?

507






Can namespace contain the private class?

485


Explain About Global.asax

564


What is a delegate how is it type safe?

461


How do I create a multilanguage, single-file assembly?

490


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?

555


Explain the working of serialization?

483


What is generic delegate in c#?

450


What are generics in c#.net?

600


What is a .exe extension files? How is it similar to .dll extension files?

572


what is the Difference between the public and private ?

510