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 is the concept of strong names?

984


What is overriding in c#?

884


What are fields in c#?

893


How to use delegates with events?

989


Is null in c#?

879


What are the steps to make an assembly to public?

987


What is cls, cts and clr in net?

914


Is there an equivalent to the instanceof operator in visual j++?

966


Describe an abstract class?

991


What is the delegate in c#?

911


Can a method return multiple values in c#?

864


What is the function of .IsDescendent()?

1023


Explain the OOPS concept in C#?

970


Define Final Class in C#

1031


Explain the difference between “constant” and “read-only” variables used in c#?

1028