Serializable
, Comparable<Modifier>
, Constable
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.EnumDesc<E extends Enum<E>>
Enum Constant | Description |
---|---|
ABSTRACT |
The modifier abstract
|
DEFAULT |
The modifier default
|
FINAL |
The modifier final
|
NATIVE |
The modifier native
|
NON_SEALED |
The modifier non-sealed
|
PRIVATE |
The modifier private
|
PROTECTED |
The modifier protected
|
PUBLIC |
The modifier public
|
SEALED |
The modifier sealed
|
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 as defined in The Java Language Specification. |
static Modifier |
valueOf |
Returns the enum constant of this class with the specified name. |
static Modifier[] |
values() |
Returns an array containing the constants of this enum class, in the order they are declared. |
public static final Modifier PUBLIC
public
public static final Modifier PROTECTED
protected
public static final Modifier PRIVATE
private
public static final Modifier ABSTRACT
abstract
public static final Modifier DEFAULT
default
public static final Modifier STATIC
static
public static final Modifier SEALED
sealed
public static final Modifier NON_SEALED
non-sealed
public static final Modifier FINAL
final
public static final Modifier TRANSIENT
transient
public static final Modifier VOLATILE
volatile
public static final Modifier SYNCHRONIZED
synchronized
public static final Modifier NATIVE
native
public static final Modifier STRICTFP
strictfp
public static Modifier[] values()
public static Modifier valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is nullpublic String toString()
_
") replaced with hyphens ("-
").
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.compiler/javax/lang/model/element/Modifier.html