Numbers.java Source code

Java tutorial

Introduction

Here is the source code for Numbers.java

Source

import java.util.EnumSet;

enum Numbers {

    ONE, TWO, THREE, FOUR, FIVE
};

public class Main {

    public static void main(String[] args) {

        // create an empty EnumSet 
        EnumSet<Numbers> set = null;

        System.out.println(set);

        // create the set by getting all elements from Numbers
        set = EnumSet.allOf(Numbers.class);

        // print the updated set
        System.out.println(set);

    }
}