program without main method

can we write java program without using main method.if so how can we write? give me the full code.which is the first method to get execute? static or main
[168 byte] By [1ganesha] at [2007-11-26 16:33:24]
# 1
No one restricts u creating a class file without main method.for eg:class A{ }this will compile without main methodshanu
mshanua at 2007-7-8 22:58:07 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
You could have posted this on " Java Essential" Forums....
shagila at 2007-7-8 22:58:07 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
class a{static {System.out.println("welcome ");System.exit(0);}}
prabhusudharsana at 2007-7-8 22:58:07 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...