KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I was wondering if the below code makes any sense, since the compiler warns that "the blank final field objects may not have been initialized". Is there a better way of doing this? 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 } }
Tags (comma-separated)
Save Edits
Cancel