public enum Modifier extends Enum<Modifier>
Not all modifiers are applicable to all kinds of elements. When two or more modifiers appear in the source code of an element then it is customary, though not required, that they appear in the same order as the constants listed in the detail section below.
Note that it is possible additional modifiers will be added in future versions of the platform.
| Enum Constant | Description |
|---|---|
ABSTRACT |
The modifier
abstract |
DEFAULT |
The modifier
default |
FINAL |
The modifier
final |
NATIVE |
The modifier
native |
PRIVATE |
The modifier
private |
PROTECTED |
The modifier
protected |
PUBLIC |
The modifier
public |
STATIC |
The modifier
static |
STRICTFP |
The modifier
strictfp |
SYNCHRONIZED |
The modifier
synchronized |
TRANSIENT |
The modifier
transient |
VOLATILE |
The modifier
volatile |
| Modifier and Type | Method | Description |
|---|---|---|
String |
toString() |
Returns this modifier's name in lowercase.
|
static Modifier |
valueOf(String name) |
Returns the enum constant of this type with the specified name.
|
static Modifier[] |
values() |
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Modifier PUBLIC
publicpublic static final Modifier PROTECTED
protectedpublic static final Modifier PRIVATE
privatepublic static final Modifier ABSTRACT
abstractpublic static final Modifier DEFAULT
defaultpublic static final Modifier STATIC
staticpublic static final Modifier FINAL
finalpublic static final Modifier TRANSIENT
transientpublic static final Modifier VOLATILE
volatilepublic static final Modifier SYNCHRONIZED
synchronizedpublic static final Modifier NATIVE
nativepublic static final Modifier STRICTFP
strictfppublic static Modifier[] values()
for (Modifier c : Modifier.values()) System.out.println(c);
public static Modifier valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is null 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, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.