Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Invoking the main() from another class  RSS feed

 
David Duran
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a cleaner way to invoke the main method of a class from within another class other than below?
String[] fakeCommandLineArgs = {};
MyClass.main(fakeCommandLineArgs);
I don't intend on passing arguments to the main so I'd like to avoid creating an empty String array if possible.
 
Michael Matola
whippersnapper
Ranch Hand
Posts: 1826
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
MyClass.main( null ) ;
 
Adam Blinkinsop
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
'nuff said.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!