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?
I see. So the constructor in the abstract class is used for initializing the attributes of its subclasses?
Yes, that's right. The constructor in the abstract class can define common attributes or functionality that all subclasses share. By defining this initialization logic in the abstract class, you can avoid repetitive code in the subclasses.