The way you would set the s
-member in the parent-portion of a child-class, would be to offer a protected
constructor (it could, of course, also be public
):
protected Parent(String s) { this.s = s; }
which sets the string to the given value. You would then call this constructor as the first call in your child-constructor with
super("Whatever you want");