mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8227202: clarify Class.isEnum() doc
Reviewed-by: bpb
This commit is contained in:
parent
7ffa6686b6
commit
86adc981f1
1 changed files with 8 additions and 0 deletions
|
@ -3491,9 +3491,17 @@ public final class Class<T> implements java.io.Serializable,
|
|||
* Returns true if and only if this class was declared as an enum in the
|
||||
* source code.
|
||||
*
|
||||
* Note that if an enum constant is declared with a class body,
|
||||
* the class of that enum constant object is an anonymous class
|
||||
* and <em>not</em> the class of the declaring enum type. The
|
||||
* {@link Enum#getDeclaringClass} method of an enum constant can
|
||||
* be used to get the class of the enum type declaring the
|
||||
* constant.
|
||||
*
|
||||
* @return true if and only if this class was declared as an enum in the
|
||||
* source code
|
||||
* @since 1.5
|
||||
* @jls 8.9.1 Enum Constants
|
||||
*/
|
||||
public boolean isEnum() {
|
||||
// An enum must both directly extend java.lang.Enum and have
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue