Why would you do that? I think It's not possible for normale applications.
The only way not to use the MAIN is to write an applet.
> How do i write a java program that doesn't have any "public static void
>
> main(String[] args)" method and prints "Hello World" to the console ?
aiyan,ma - 14 Dec 2005 06:57 GMT
You can write a plugin within a platfom.
Then let the platform to launch your plugins, not JVM directly.
> Why would you do that? I think It's not possible for normale applications.
> The only way not to use the MAIN is to write an applet.
>
> > How do i write a java program that doesn't have any "public static void
> >
> > main(String[] args)" method and prints "Hello World" to the console ?
> How do i write a java program that doesn't have any "public static void
>
> main(String[] args)" method and prints "Hello World" to the console ?
public class t
{
static
{
System.out.println("Hello World");
System.exit(-1);
}
}