|Modifier and Type||Method and Description|
Returns the value of this variable if this is a
finalfield initialized to a compile-time constant. Returns
nullotherwise. The value will be of a primitive type or a
String. If the value is of a primitive type, it is wrapped in the appropriate wrapper class (such as
Note that not all
final fields will have
constant values. In particular,
enum constants are
not considered to be compile-time constants. To have a
constant value, a field's type must be either a primitive type
finalfield initialized to a compile-time constant, or
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.