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?

Answers were Sorted based on User's Feedback



why abstract class will have a constructor?..

Answer / hari krishna

All the classes including the abstract classes can have
constructors.Abstract class constructors will be called
when its concrete subclass will be instantiated.

Is This Answer Correct ?    7 Yes 1 No

why abstract class will have a constructor?..

Answer / nitin panwar

Bcoz each subclass executes the superclass constructor
before executing own constructor,thats why abstract class
has a constructor .

Is This Answer Correct ?    4 Yes 1 No

why abstract class will have a constructor?..

Answer / 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

why abstract class will have a constructor?..

Answer / ram

Abstract class have the constructor in it just to instantiate its instance variables. Where as Interfaces are not containing any instance variables. That is why, they dont have constructor concept.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

Do you know how to reverse string in java?

0 Answers  


An inner class can actually be a subclass of the outer class? a. true b. false

2 Answers  


Relationship between an event-listener interface and an event-adapter class?

1 Answers  


What is a function in java?

0 Answers  


i need example for java abstraction. where we use abstraction and why we need abstraction.

2 Answers   Oracle,


What is null data type?

0 Answers  


How to Create A Wapper Class in core Java and Why are Use in java?

2 Answers   Amdocs,


What is the purpose of object oriented programming?

0 Answers  


What is hash method?

1 Answers  


What is tree node in java?

0 Answers  


What is immutable class? how to make a Class explicitly "Immutable"?Wap to make a class explicitly immutable.

3 Answers  


What two classes are used to read data only?

0 Answers   TryTechnicals Pvt Ltd,


Categories