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").
Show differencesHistory of post edits
#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").
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").