KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I came across the following code in a code base I am working on: public final class ConfigurationService { private static final ConfigurationService INSTANCE = new ConfigurationService(); private List providers; private ConfigurationService() { providers = new ArrayList(); } public static void addProvider(ConfigurationProvider provider) { INSTANCE.providers.add(provider); } ... INSTANCE is declared as final . Why can objects be added to INSTANCE ? Shouldn't that invalidate the use of final. (It doesn't). I'm assuming the answer has to do something with pointers and memory but would like to know for sure.
Tags (comma-separated)
Save Edits
Cancel