Need to use public,static keywords in main function?

Answer Posted / sreedhar

yes,need two thing, javac execution start with main
method,that method declars the private,protected not access
the out side class.

Staic block is execute the first part of the progream ,u
need to mention the Staic on thet main method.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you add and remove nodes in jtree?

610


Why we use protected in java?

530


How dead lock situation occurs in java and how you can identify it?

538


Can we extend a class with private constructor?

521


What are filterstreams?

603






What is sleep method?

618


What is abstraction in java?

613


Explain restrictions for using anonymous inner classes?

582


Which sort is best in java?

522


Define class?

512


Differentiate between a constructor and a method? Can we mark constructors final?

671


What are the two environment variables that must be set in order to run any java programs?

523


Is it possible to override private or static method in java?

540


What is a java lambda expression?

549


What is an object class?

551