You can add a constant to a class, primitive type, or interface at any time. Constants defined in methods are available only in the method in which they are defined.
Global constants are associated with a schema and its subschemas. Class constants are associated with a class and its subclasses. Primitive type and interface constants are associated with a primitive type or interface, respectively.
For details about renaming a user-defined global or class constant selected within the body of a method in the editor pane, see "Renaming or Changing an Entity", later in this chapter.