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 a set
        EnumSet<Numbers> set;

        // add elements
        set = EnumSet.of(Numbers.FIVE, Numbers.FOUR, Numbers.THREE, Numbers.TWO);

        System.out.println(set);

    }
}