public static void main(String args)
System.out.println("Program executed without class");
In java everything within a class But here i used enum keyword.This program successfully executed so what is the reason behind that?
and this program executed only with put semicolon(;) after first curly braces
My doubt is How this program executed and give reason anyone.
An enum starts by listing the enum values, then there's a semicolon, then the rest of the enum body. In your case, you listed zero enum values, and then there's the semicolon to indicate the end of the value listing.