File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Can a JAVA program run without a main method()? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic

Can a JAVA program run without a main method()?

Hari Dhanakoti

Joined: Jan 04, 2007
Posts: 6
Here is the piece of code which runs without a main function.
Help me in this problem

class EndNow
public void p()
System.out.println("It also........");


class MainLess
System.out.println("hi it worked ");
EndNow e = new EndNow();

Regards<br />Hari
Christophe Verré

Joined: Nov 24, 2005
Posts: 14687

Please stop asking the same question in different forums. Continue the conversation there :

[My Blog]
All roads lead to JavaRanch
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Can a JAVA program run without a main method()?
Similar Threads
Do Java program can run without main function()? If not please solve this problem
Having trouble with switch, case,break,
Program without main method
Program without a main method