This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft 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 Java 8 in Action this week in the Java 8 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: 1464
    
    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: 923
    
    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.


OCPJP 6(100 %) OCEWCD 6(91 %) OCPJBCD(93%)
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
how to run a normal java program without main method
Can we write a java program without main method?
need help plss
Main methods in servlets
Do Java program can run without main function()? If not please solve this problem