• Post Reply Bookmark Topic Watch Topic
  • New Topic

Which main() shall work?  RSS feed

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If we have a program with 2 classes each having it's main function.What shall determine which main() function shall work.
 
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what you type when you start your application...

c:>java <classnamehere>

 
Lovish Setia
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Eclipse SDK and not command line.
 
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lovish Setia wrote:I am using Eclipse SDK and not command line.


With Eclipse, you have to click on the class that you want to "run...". Eclipse runs the main() method of the class that you clicked on.

Henry
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

when you run from eclipse , one dialog will be shown before you for choose one class from two .
 
Lovish Setia
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you to all for their replies.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!