Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

What rule of main method chose (if present in one file two class with main method)

 
Sergej Smoljanov
Ranch Hand
Posts: 470
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

What rule of main metod chose (if present in one file two class with main method)?
 
Roel De Nijs
Sheriff
Posts: 10763
148
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try to compile the source file from your original post and see what happens...
 
Joanne Neal
Rancher
Posts: 3742
16
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sergej Smoljanov wrote:What rule of main metod chose (if present in one file two class with main method)?

What command line did you use to run the program ? That should give you a clue as to which main is used.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!