Ans: Yes, we can compile and execute without a class.
Let’s see the following code:
Test43.java
enum Test43{
;
public static void main(String[] args)
{
System.out.println("Silan Technology");
}
}
Output
Silan Technology