In a concrete class, declaration of a constructor for a concrete type Fnord effectively exposes two things:
A means by which code can request the creation of an instance of Fnord
A means by which an instance of a type derived from Fnord which is under construction can request that all base-class features be initialized.
While there should perhaps be a means by which these two abilities could be controlled separately, for every concrete type one definition will enable both. Although the first ability is not meaningful for an abstract class, the second ability is just as meaningful for an abstract class as it would be for any other, and thus its declaration is just as necessary and useful.
An abstract class can have a constructor BUT you can not create an object of abstract class so how do you use that constructor?
Thing is when you inherit that abstract class in your subclass you can pass values to its(abstract's) constructor through super(value) method in your subclass and no you don't inherit a constructor.
so using super you can pass values in a constructor of the abstract class and as far as I remember it has to be the first statement in your method or constructor.
In a concrete class, declaration of a constructor for a concrete type Fnord effectively exposes two things:
A means by which code can request the creation of an instance of Fnord
A means by which an instance of a type derived from Fnord which is under construction can request that all base-class features be initialized.
While there should perhaps be a means by which these two abilities could be controlled separately, for every concrete type one definition will enable both. Although the first ability is not meaningful for an abstract class, the second ability is just as meaningful for an abstract class as it would be for any other, and thus its declaration is just as necessary and useful.
An abstract class can have a constructor BUT you can not create an object of abstract class so how do you use that constructor?
Thing is when you inherit that abstract class in your subclass you can pass values to its(abstract's) constructor through super(value) method in your subclass and no you don't inherit a constructor.
so using super you can pass values in a constructor of the abstract class and as far as I remember it has to be the first statement in your method or constructor.
As described by javafuns here, this is an example: