Results 1 to 3 of 3

Thread: Question

  1. #1
    Junior Member
    Join Date
    Oct 2007
    Answers
    2

    Question

    can i run a program without main in java, if so write the code for that


  2. #2
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    Re: Question

    Question moved to proper forum .


  3. #3
    Junior Member
    Join Date
    Mar 2008
    Answers
    7

    Answer for writing java prog without main()

    Yes,we can write .

    class X
    {
    static{
    System.out.println("This is static block");

    public void show(){System.out.println("This is show()");
    }

    /**u can place System.exit(0); to ignore exception
    */
    System.exit(0);
    }//static block end here
    }


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact