Answers for "n we execute any program without main in java? Explain it with the help of suitable program ."

2

run a java class without main method

//This is prior to Java 7
class StaticInitializationBlock{
   static{
      System.out.println("class without a main method");
      System.exit(0);
   }
}
Posted by: Guest on July-21-2020

Code answers related to "n we execute any program without main in java? Explain it with the help of suitable program ."

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language