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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring 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: 187
Is it possible to compile and run a java program without writing main() method???
Anayonkar Shivalkar
Bartender

Joined: Dec 08, 2010
Posts: 1509
    
    5

Yes.


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

Joined: Jun 02, 2012
Posts: 187
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.
 
Don't get me started about those stupid light bulbs.
 
subject: Java program without writing main() method?