The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
December 2000

Advertisement

Advertisement

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.

Message:

How do I share main() behavior across multiple classes?

Posted by Michael Pelz-Sherman on December 27, 2000 at 7:30 PM

I need to create a set of Java applications that share the same basic behavior.

My first notion was to create an abstract class, write its "main()" method to call a bunch of "abstract" methods which I could then override in subclasses. The problem is, how to I know which class to tell main() to instantiate?

Perhaps I'm barking up the wrong tree and sharing main() behavior is the wrong approach.

Any pointers would be much appreciated!

- Michael




Replies:

Sponsored Links



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