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 to calculate the length of a singly linked list in java?

589


Why we used break and continue statement in java?

567


Is a class subclass of itself?

608


What is a priority queue java?

530


Can we assign null to double in java?

556






What is %d in printf?

534


How do you convert an int to a string in java?

548


What does sizeof return?

563


What is the use of default method in interface in java? Explain

555


Explain the differences between abstraction and encapsulation?

527


Describe what a thread-local variable is in java?

575


What is difference between iterator access and index access?

650


What is the purpose of the enableevents() method?

587


What is the generic class?

533


Why spring singleton is not thread safe?

572