enum can have public static void main() method . main() method in enum executes just like its execution in any other class.

The below example explains the main method in enum.

Demo Example : main() Method in enum

MONTHS.java

package com.masterjavatutorial;
public enum MONTHS {
	 
	JAN,FEB,MAR,APR,MAY,JUNE,JULY,AUG,SEP,OCT,NOV,DEC;

	public static void main(String args[]){
	   MONTHS[] values = MONTHS.values(); 
	   for(MONTHS value : values){
	      System.out.println(value); 
	   }
	}
	  
}

Output of the above method is as below:

JAN
FEB
MAR
APR
MAY
JUNE
JULY
AUG
SEP
OCT
NOV
DEC