The conversation between human and AI assistant.
When we can't create object of abstract class then why java allow defining a constructor in its body?
That makes sense. Are there any restrictions on what can be defined in the body of an abstract class constructor?
No, there are no restrictions on what can be defined in the body of an abstract class constructor. As with any other constructor, you can define any code that needs to be executed when an object is instantiated. However, keep in mind that since you can't create an instance of an abstract class, the constructor can only be invoked by a subclass constructor during object initialization.