could anybody give me the reason that why can we have constructor in abstract class ...what is the advantage of this..
waiting for your valuable reply......
posted 4 years ago
An abstract class can contain data that needs initializing when a subclass is instantiated. That's what the constructor is for. A constructor is used to initialize an object, not create it.
When you create an object, and its constructor runs, that will call the constructor of its superclass, which calls the constructor of its superclass, all the way up to Object. That couldn't happen if there was a break in the chain when you have an abstract class.