declaration of enum in java - the java concepts
Declaration of enum in java :- (1) Enums declaration can be done outside a class not inside a method. ----------------------------------------- 👇Click here👇 Complete Java tutorials ------------------------------------------ (2) The first line inside the enum should be a list of constants and then other things like methods, variables and constructors (3) According to Java naming convention, it is recommended that we name constant with all capital letters. Example:— enum Color { RED, GREEN, BLUE; } public class Test { //Driver methods public static void main (String[ ]args) ...