Is there any way to write a Java prg without main()

I would like to know Is there any way to write a Java program without using main() function.
[99 byte] By [AdinarayanaH261a] at [2007-10-2 20:16:40]
# 1

Well, the same answer to the once-a-week question: yes, but you shouldn't do it.

public class MyClass {

static { System.out.println("They'll kill you for that"); }

}

CeciNEstPasUnProgrammeura at 2007-7-13 22:59:03 > top of Java-index,Java Essentials,Java Programming...
# 2
i am unable to execute the program ..............i think there must be a main method through with the program starts
craju45a at 2007-7-13 22:59:03 > top of Java-index,Java Essentials,Java Programming...
# 3

> i am unable to execute the program ..............i

> think there must be a main method through with the

> program starts

The program can be compiled and run. After running it, you'll see "They'll kill you for that" followed by something like "java.lang.NoSuchMethodError: main" and finally someone with a big Volvo will burst into your room and runs you over.

prometheuzza at 2007-7-13 22:59:03 > top of Java-index,Java Essentials,Java Programming...
# 4
That would be Kaj. My Volvo isn't as big.
CeciNEstPasUnProgrammeura at 2007-7-13 22:59:03 > top of Java-index,Java Essentials,Java Programming...
# 5
> That would be Kaj. My Volvo isn't as big.Really? I always imagined you had someyhing like a Volvo 242 TURBO.
prometheuzza at 2007-7-13 22:59:03 > top of Java-index,Java Essentials,Java Programming...
# 6
if you write a java applet :P you want have main >> :) you will have init :+P)if you write java midlet you will heve startApp i thinkall are "programs"
JOKea at 2007-7-13 22:59:03 > top of Java-index,Java Essentials,Java Programming...
# 7
if you use Netbeans you won't be able to find main()
Michael_Dunna at 2007-7-13 22:59:03 > top of Java-index,Java Essentials,Java Programming...