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.
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.