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 abstract class will have a constructor?

Answer Posted / aditya ganjiwale

Its there to be able to initialize the abstract class
internal state.
Lets say you would like to assign two variables, you would
have to do this for every implementation, but with
constructors in the abstract class you only need it once:
So every class inheriting only needs to call the
constructor, instead of assigning the values themself every
time.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between double and float variables in java?

1201


What is the symbol for average?

1081


What is bean? Where it can be used?

1141


What is byte value?

1044


What is the impact of declaring a method as final?

1072


What is module with example?

1100


Can a java program have 2 main methods?

1103


How to calculate the length of a singly linked list in java?

1092


What is difference between char array and string?

1181


Which variable is the independent variable?

1031


What is an iterator interface in java programming?

1026


Where and how can you use a private constructor?

1048


What is Java Package and which package is imported by default?

1155


What the difference is between execute, execute Query, execute Update?

888


How do you ensure that n threads can access n resources without deadlock?

1356