Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

What does exclamation mark mean c#?

947


Explain how can I get around scope problems in a try/catch?

862


How main method is called in c#?

898


What is a method signature in c#?

883


What is access modifier in c#?

842


Why we use oops in c#?

932


What is var c#?

915


What is event and delegates in c#?

933


Which is executed if an exception has not occurred?

902


What is writeline in c#?

818


What is generic delegates in c#?

915


Can you see a loop recorder?

816


Why is ienumerable used?

841


What is difference between ilist and list?

847


What are abstract classes in c#?

832