How do you get Eclipse to auto-generate a main method for a new Java class?


Does anyone know a reason why my Eclipse does not preload

public static void main(String[] args)

when I create a new class? What can I do to make it appear automatically?


Answers:


"what can i do to make it appear automatically? "

  • Go to create New Java Class dialog
  • See a part that says "Which method stubs would you like to create?"
  • check public static void main(String[] args)

enter image description here