Spy.java Source code

Java tutorial

Introduction

Here is the source code for Spy.java

Source

import java.lang.reflect.Field;

enum Spy {
    BLACK, WHITE
}

public class Main {

    public static void main(String... args) throws Exception {
        Class<?> c = Class.forName("Spy");
        Field[] flds = c.getDeclaredFields();
        for (Field f : flds) {
            System.out.println(f.isEnumConstant());

        }
    }
}