Me preguntaba si el siguiente código tiene algún sentido, ya que el compilador advierte que "los objetos de campo final en blanco pueden no haberse inicializado". ¿Hay una mejor manera de hacer esto?Clase abstracta con campo no inicializado final
public abstract Test {
protected final ArrayList<Object> objects;
}
public TestSubA extends Test {
public TestSubA() {
objects = new ArrayList<Objects>(20);
// Other stuff
}
}
public TestSubB extends Test {
public TestSubB() {
objects = new ArrayList<Objects>(100);
// Other stuff
}
}
+1: por el interés en hacer lo correcto. – helios