Menu

How to run a Java Application or program without main method?

Below is the code snippet to execute and run a java program without main method.


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
package rashid.jorvee;

import javafx.stage.Stage;

public class RunAJavaApplicationWithoutMainMethod extends javafx.application.Application {
 
 @Override
 public void start(Stage primaryStage) throws Exception {
  System.out.println("Running Application!!!");
 }
}

No comments:

Post a Comment