aspose file tools
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
Register / Login


JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply 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: 1295

Yes.


Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD)
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: 892

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.


OCPJP 6(100 %) OCEWCD 6(91 %)
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://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Java program without writing main() method?
 
Similar Threads
Main methods in servlets
need help plss
Do Java program can run without main function()? If not please solve this problem
how to run a normal java program without main method
Can we write a java program without main method?