class BBB { public BBB(String x) { } void foo(String s) {} } class AAA extends BBB { public AAA(String x) { String y = x.trim(); super(y.length() > 0 ? y : "aaaa"); } @Override void foo(String s) { String y = s.trim(); super.foo(y.length() > 0 ? y : "aaaa"); //To change body of overridden methods use File | Settings | File Templates. } }