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...

why the abstract class has default constructor?

Answer Posted / ranganathkini

A class has a constructor so that when an instance of the
class is created, the fields of the class can be setup to a
initial valid state.

Abstract classes define partial implementation of a public
contract. Which means that it may implement some of the
methods and contains partially implemented methods that are
marked abstract.

Since abstract classes can have partial implementation and
such partial implementation can include fields of the class,
a constructor becomes necessary so that those fields are
initialized to a valid default state when they are created
thru the constructor of their concrete subclasses.

Is This Answer Correct ?    12 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between wait and notify in java?

1202


What is size () in java?

1151


What kind of variables a class can consist of?

1156


Do extraneous variables affect validity?

958


What are the uses of synchronized keyword?

1051


What are the advantages of inner classes?

1066


Explain why wait(), notify() and notifyall() methods are in object class rather than in the reading class?

1029


How do you decide when to use arraylist and linkedlist?

1049


What is volatile keyword in java

1185


Is nan false?

1050


What is compareto?

1105


Can we have more than one package statement in source file ?

1096


Why generics are used in java?

1100


Explain spliterator in java8?

1099


What is the difference between menuitem and checkboxmenu item?

1381