This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Java program without writing 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 » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Java program without writing main() method?" Watch "Java program without writing main() method?" New topic
Author

Java program without writing main() method?

Gaurangkumar Khalasi
Ranch Hand

Joined: Jun 02, 2012
Posts: 186
Is it possible to compile and run a java program without writing main() method???
Anayonkar Shivalkar
Bartender

Joined: Dec 08, 2010
Posts: 1502
    
    5

Yes.


Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
Gaurangkumar Khalasi
Ranch Hand

Joined: Jun 02, 2012
Posts: 186
Anayonkar Shivalkar wrote:Yes.


Thanks...

Related Threads:
http://www.coderanch.com/t/407661/java/java/we-write-java-program-without
http://www.coderanch.com/t/471679/java/java/run-normal-java-program-without
http://www.coderanch.com/t/407561/java/java/Do-Java-program-run-without
http://www.coderanch.com/t/406107/java/java/Program-without-main-method
http://www.coderanch.com/t/383115/java/java/JAVA-program-run-without-main
gurpeet singh
Ranch Hand

Joined: Apr 04, 2012
Posts: 924
    
    1

Gaurangkumar Khalasi wrote:Is it possible to compile and run a java program without writing main() method???


what you are asking is quite generalized. as Ayonkar said you can compile and run java program without main method. but for the exam perspective if we have java desktop application then if there is no main method with the signature as public static void main(String...args) then the jvm will throw runtime exception.
saloni jhanwar
Ranch Hand

Joined: Feb 09, 2012
Posts: 583

Gaurangkumar Khalasi wrote:Is it possible to compile and run a java program without writing main() method???


I don't write main() in each java code file and it is also meaningless to write main() in each java code file,I write main() only when I am going to execute that file else other java code files are usually I use to write only classes.


Tell the difficulties that i am difficult.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java program without writing main() method?
 
Similar Threads
Do Java program can run without main function()? If not please solve this problem
Can we write a java program without main method?
Main methods in servlets
need help plss
how to run a normal java program without main method