FirstNaukri
Home Search Jobs Govt JobsNew Resume Makernew Career Guidance Ask n Answer Student Ambassadors

Register|Login

  Ask n Answer
  Ask a Question
0 out of 300 characters

QUESTION
can a java program works without a main method?.....
By K.APARNA (Beginner)  3 years ago   19 views
 
 Your Answer
0 out of 1250 character
 
 
 
Share |
Report Abuse
 
 
 
 
ANSWERS (2)
 
 
 
 
SUCITRA.M (Mentor) 3 years ago
if there is a static block in a java program,the class loader loads all static block before java gives call to main() method!. however after the execution of the static block an error message appears as NO MAIN METHOD FOUND..
 
 
 
Know a better answer? Click here to post.
 
 
It was possible to do this till Java SE 6 but from Java SE 7 it doesn't work anymore.
 
 
 
Know a better answer? Click here to post.
 
 
 
 
 

Ask & Answer
Panel of Experts

 
 
 
 
 
All rights reserved © 2020 Info Edge (India) Ltd.