because GenericClass
has null
values for those FIELD_1
, FIELD_2
, FIELD_3
public abstract class GenericClass extends JFrame
{
protected static String FIELD_1;
protected static String FIELD_2;
protected static String FIELD_3;
public GenericClass()
{ // null +" " +null+null = `null nullnull`
super(FIELD_1+" "+FIELD_2+FIELD_3);
}
}
This was the idea: GenericClass should just DECLARE fields and subclasses should initialize them. – Danylo Esterman 41 secs ago
You can't have it that way for fields, You need to overload abstract class's constructor and force subclass to pass parameters during constructor (by hiding default constructor) and then use those passed parameter for JFrame
's constructor