The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
December 2001



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


How do you get a class name from the main() method

Posted by subhash on December 12, 2001 at 11:17 PM

As main() is static, I dont have a this to do getClass(). This requirement comes from my design of a base class which defines how the derived classes should be launched (i.e. has a final main())
Goog old C++ gives atleast the program name as the first argument :)

  • getClass() Mike December 15, 2001 at 1:21 AM (0)

Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us