ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

Can we execute a java program without main function?

user-image
تم إضافة السؤال من قبل Salman Ahmed , SAP ABAP S4-HANA Consultant , Deloitte - India
تاريخ النشر: 2015/08/18
Mohammad Hakim
من قبل 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
من قبل Eyuel Shewarga , Software Developer , Maraki Soft Technologies

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

المزيد من الأسئلة المماثلة

هل تحتاج لمساعدة في كتابة سيرة ذاتية تحتوي على الكلمات الدلالية التي يبحث عنها أصحاب العمل؟