• www.uptuexam.com
  • GBTU Results 2014
  • MTU Results 2014
  • UPTU Circulars
  • COP Result 2012,13,14
  • UPTU Previous Papers
  • GATE study material
  • Robotics Projects
Thank you for visiting www.UPTUexam.com " Free download Exam materials, previous year question papers, free ebooks & Providing Important Questions To Do their Exams Well and Totally a FREE SERVICE for all engineering streams (B.Tech)."

how to execute a program without main().


how to execute a program without main().


PROGRAM First3.java
           public class First3
               {
                  static
                   {
                      System.out.println("It is executing without main()......");
                       System.exit(0);
                        } 
                         } 


                Output –







                1. PROGRAM :
                2. public class First
                3. {
                4. public static void main()
                5. {
                6. System.out.println("It is overloaded main.....");
                7. }
                8. static
                9. {
                10. main();
                11. }
                12. public static void main(String args[])
                13. {
                14. System.out.println("It is invoked by JRE");
                15. }
                16. }


                Output –










                Signature of Method –


                modifier returnType methodName(Argument list)

                {
                               -------------
                               -------------
                               -------------          

                }












                No comments:

                Post a Comment