I have the following classes:
public abstract class ParentClass
{
public ParentClass()
{
throw new RuntimeException(\"An ID must be specified
calling an inherited constructor to instantiate the class?
Constructors are never inherited, and it doesn't really make sense. A constructor just initializes the state in that particular class. You can't expect a constructor of Parent
to initialize the state of Child
class. That's the job of constructor in Child
class only.
So, no you can't do what you are trying to do. And that's not the issue with Spring. That's pretty much fundamental.