Will the below code of enum compile??

MONTHS.java

package com.masterjavatutorial;
public enum MONTHS {

     public void methodOne(){
    	 System.out.println("Method One");
     }
	
}

Semicolon is mandatory if any method is declared in enum class. Semicolon must be declared before a method in an enum class.

The below code will compile fine :

MONTHS.java

package com.masterjavatutorial;
public enum MONTHS {
     ;
     public void methodOne(){
    	 System.out.println("Method One");
     }
	
}