When should we use an uninitialized static final variable? I know that an uninitialized static final variable can only be assigned values in the static initializer block, but I can’t think of any real use for this.
When should we use an uninitialized static final variable? I know that an uninitialized
Share
I assume you mean:
with no initial value explicitly assigned?
You can assign it in the
staticblock based on some computation that can only occur at runtime, like reading some property file to create an Application-wide constant that is not known at compile time.