Friday, 28 December 2012

Core Java Interview Questions 3


By on 00:41


13. What are instance variables?
Instance variables are those which are defined at the class level. Instance variables need not be initialized before using them as they are automatically initialized to their default values.
14. How to define a constant variable in Java?
The variable should be declared as static and final. So only one copy of the variable exists for all instances of the class and the value can't be changed also.
static final int PI = 2.14; is an example for constant.
15. Should a main() method be compulsorily declared in all java classes?
No not required. main() method should be defined only if the source class is a java application.
16. What is the return type of the main() method?
Main() method doesn't return anything hence declared void.
17. Why is the main() method declared static?
main() method is called by the JVM even before the instantiation of the class hence it is declared as static.
18. What is the arguement of main() method?
main() method accepts an array of String object as arguement.

About Syed Faizan Ali

Faizan is a 17 year old young guy who is blessed with the art of Blogging,He love to Blog day in and day out,He is a Website Designer and a Certified Graphics Designer.

7 comments:

  1. I blog frequently and I seriously appreciate your content.
    This article has really peaked my interest. I am going to book mark your
    site and keep checking for new information about once a week.
    I subscribed to your RSS feed as well.

    Feel free to surf to my blog :: what are binary Options

    ReplyDelete
  2. It's genuinely very complicated in this full of activity life to listen news on Television, so I only use web for that reason, and obtain the most up-to-date news.

    my blog post ... cedar finance reviews

    ReplyDelete
  3. excellent submit, very informative. I'm wondering why the opposite experts of this sector do not understand this. You must proceed your writing. I'm confident, you've a great readers' base already!


    Here is my weblog - cedar finace

    ReplyDelete
  4. Hiya! I know this is kinda off topic but I'd figured I'd ask.

    Would you be interested in trading links or maybe
    guest authoring a blog post or vice-versa? My blog covers a lot of the same
    topics as yours and I feel we could greatly benefit from each other.
    If you are interested feel free to send me an e-mail. I look forward to hearing from you!
    Fantastic blog by the way!

    My page - cedarfinancial.com

    ReplyDelete
  5. Thanks for another informative blog. The place else may I am getting that type of information written in such
    an ideal approach? I've a challenge that I am just now working on, and I've been at the
    glance out for such information.

    Here is my blog post :: make money online for free

    ReplyDelete
  6. Helpful information. Lucky me I found your web site unintentionally, and I'm stunned why this twist of fate didn't took place in
    advance! I bookmarked it.

    Feel free to visit my site :: cedar finance monthly fee

    ReplyDelete
  7. Having read this I believed it was extremely informative.
    I appreciate you spending some time and energy to put this article together.

    I once again find myself spending way too much time both reading and leaving comments.
    But so what, it was still worthwhile!

    My web blog; trading binary options

    ReplyDelete