15 Sep Create New Enum in Eclipse
Enum has fixed set of constants, which improves type safety. It is a datatype consisting of a set of named values. Let’s see how to create new Enum in Eclipse.
Launch Eclipse and click the File menu,
File > New > Enum
After clicking Enum above, a new dialog box will open. This section provides you with options to create new Enum.
The following options are provided while creating Enum in Eclipse.
Source Folder
Mention the source folder for the enum or click Browse to select a source folder via a dialog.
Package
Mention the package here, in which the new enumgets added. Go for this option or select the Enclosing Type option.
Enclosing type
Select a type here, to enclose the new enum. Select this or the Package option above.
Name
You need to type the name of the new enum here.
Modifiers
Select modifiers: public, private, protected. You need to select one or more access modifiers for the new enum.
Interfaces
Choose interfaces by clicking Add, which the new interface extends.
Do you want to add comments?
Select the option, if you want the comments to be added to the new class.
David Cone
Posted at 02:13h, 04 JuneWhat are valid enclosing types? I’m trying to make an enum of integers.