public enum Hobby extends Enum<Hobby>
Enum Constant and Description |
---|
CHESS |
GOLF |
MOTORCYCLES |
POKER |
TENNIS |
Modifier and Type | Method and Description |
---|---|
String |
getCode() |
static Hobby |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Hobby |
valueOfCode(String code) |
static Hobby[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Hobby TENNIS
public static final Hobby GOLF
public static final Hobby MOTORCYCLES
public static final Hobby CHESS
public static final Hobby POKER
public static Hobby[] values()
for (Hobby c : Hobby.values()) System.out.println(c);
public static Hobby 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 nullpublic String getCode()
Copyright © 2006-2014 JBoss by Red Hat. All Rights Reserved.