Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

Can we execute a java program without main function?

user-image
Question ajoutée par Salman Ahmed , SAP ABAP S4-HANA Consultant , Deloitte - India
Date de publication: 2015/08/18
Mohammad Hakim
par Mohammad Hakim , Technical Head , Middle East Technologies

Yes and NO..

Yes, we can execute if we run the program in a container such as Servlet container (Tomcat etc)..

 

No (not if we closely look into containers), because the servlet container need to be running and it wouldn't be started unless there is a main class (Bootstrap if you refer catalina start script) which is started again using java command..

 

in case of a standalone "java program" the answer is NO.

Eyuel Shewarga
par Eyuel Shewarga , Software Developer , Maraki Soft Technologies

No we can't the main function( method) is the start point of execution.

More Questions Like This

Avez-vous besoin d'aide pour créer un CV ayant les mots-clés recherchés par les employeurs?