blob: 09fcc98e69d84830405f719424b021df39c53a68 [file] [log] [blame]
jeffhao5d1ac922011-09-29 17:41:15 -07001// Copyright 2008 The Android Open Source Project
2
3import java.lang.reflect.Field;
4
5/**
6 * Try some stuff with enumerations.
7 */
8public class Main {
9 public enum Shubbery { GROUND, CRAWLING, HANGING }
10
11 public static void main(String[] args) {
12 Field field;
13 try {
14 field = Shubbery.class.getDeclaredField("CRAWLING");
15 } catch (NoSuchFieldException nsfe) {
16 throw new RuntimeException(nsfe);
17 }
18
19 System.out.println("found field " + field.getName());
20 System.out.println(" synthetic? " + field.isSynthetic());
21 System.out.println(" enum? " + field.isEnumConstant());
22 }
23}