Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#ActualMoroS84

Posted 14 August 2012 - 05:34 AM

Hello again.

I didn't see an option like that anywhere. Maybe it's because that when you do a project, you should have only one class with the main() method, so basically: yes, you have to check them every time.

However, since you're using Eclipse, then you have some code templates built in (other Java IDEs have them too of course). You can use that to add the main() method a bit faster. When you have a class open, you just have to type "main" in the line, where you want the main() method to appear and press Ctrl+Space (Cmd+Space on a Mac if I remember correctly) and press Enter (choosing the first option from the window that'll appear: "main method").

#1MoroS84

Posted 14 August 2012 - 05:33 AM

Hello again.

I didn't see an option like that anywhere. Maybe it's because that when you do a project, you should have only one class with the main() method, so basically: yes, you have to check them every time.

However, since you're using Eclipse, then you have some code templated built in (other Java IDEs have them too of course). You can use that to add the main() method a bit faster. When you create a new class, you just have to type "main" in the line, where you want the main() method to appear and press Ctrl+Space (Cmd+Space on a Mac if I remember correctly) and press Enter (choosing the first option from the window that'll appear: "main method").

PARTNERS