java - Main method empty? -


i have class implements runnable, eclipse needs public static void main method in it. ok if main completly empty?

public class launcher implements runnable{ private string message;  public launcher(string message) {      this.message= message; }  public static void main(string[] args) { }  @override public void run() {  //my implementations } 

if intend launcher main class of application, 1 use start it, main method needed , must whatever should done start work.

if not, delete main method. eclipse not require main method unless start application telling run class. optionally generate 1 when creating class, can edited out if not needed.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -