Discussion Forums

New User? Please read instructions!

Can we execute a program without main() method?  

  RSS

vinaykumarj
New Member
Joined: 2 months  ago
Posts: 1
23/04/2017 3:04 pm  

Yes, one of the way is static block but in previous version of JDK not in JDK 1.7.

Program to Understand :

class A3{  

  static{  

  System.out.println("static block");  

  System.exit(0);  

  }  


ReplyQuote
  
Working

Please Login or Register

Ask your questions or clarify your/others doubts from,

✅ Online Discussion Forums by Fresh2Refresh.com





Share this website !!!
Facebook Twitter Linkedin

Close
We Support JALLIKATTU !!!
We Support JALLIKATTU!
By Fresh2Refresh.com
Show Your Support as well. Thanks!