AceTheInterview
Jobs in Pune | Work better in teams | Socialize with friends | Submit Q&A | Tell a friend
Search site for 

Top 100 Interview Questions & Answers in a convenient and easy to read book!

“I bought this guide a few days ago to prepare for my interview with Oracle. Many of the questions they asked me were from this guide. I found this book absolutely great!”

– Ravi, California

Read more comments...

Interview Questions And Answers RSS Feed

Answers »

  1. Submitted By: shilpi — December 11, 2008
    -1 votes
      + -

    private keyword are not use because it is not capable to access the function of another class.

  2. Submitted By: Sagar — February 23, 2009
    +5 votes
      + -

    “public static void main(String args[])”

    This is the main method signature, and entry point of execution which is searched by JVM when we execute some class. If no such method exits, JVM throws exception, complains “NoMainMethodFound”..

    Now If we don’t provide “public” and give “private” as a access specifier, which is accessible within a class itself, then How JVM class loader will find “main” method and execute it..

  3. Submitted By: Rohit Raman — March 23, 2009
    +12 votes
      + -

    public static void main(String args[]):

    The above signature is so because, JVM is a program which tries to access your class code. So, your class code has to be marked public.
    It is static because your class is the entry point into the execution, that is why its object cannot exist beforehand. Unless the class is marked static, it would’nt be available to another program(JVM) for access.

    It is void because JVM is kind of ’silly’ which just knows how to start the execution. It knows nothing about return types and what to do with the return values. Thats why we say that main method does’nt have anything to return to anybody.

    The arguments are String array, as String is the highest data type in Java. Anything can be converted into String and anything can be converted from String to the respective data type. The JVM designers want to give the programmer to choose his arguments, that’s why they chose the highest data type.

    Thanks,

    Rohit Raman

  4. Leave an Answer/Comment

    To prove you're a person (not a spam script), type the security text shown in the picture. Click here to regenerate some new text.
    Click to hear an audio file of the anti-spam word

Our Sponsors
Our Sponsors
Contact Us | FAQ | Sitemap | Terms of Use | Privacy Policy | Tell a Friend

Copyright © 1999-2006 Jeeve Technologies LLC. All rights reserved.