On Jan 17, 2008 4:25 AM, Bill Venners <
bv-jackrabbit@...> wrote:
>
> > But the problem you are hitting is that you have both a class MyApp
> > and an object MyApp. main won't work in such cases. Rename the class
> > MyApp and you'll be fine. You'll see that object MyApp compiles to
> > MyApp.class and MyApp$.class while class MyApp also compiles to
> > MyApp.class - a collision. Class MyApp dominates instead of there
> > being a merge (which might be hard with incremental compiling,
> > separate compiling, etc).
> >
> In which case I need to update the book because it is wrong. It should
> say that any *standalone object* with a main of the proper signature
> can be used as an entry point into an application.
Isn't the problem not that it's a standalone object, but there's a
collision between an object-called-MyApp and class-called-MyApp? You
could mix other objects in there as well, but the name of the
application object should be unique.
Alex