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

What is the return type of the main method?

788


Is array an object in java?

728


What is the difference between method and means?

791


Is singleton a bad practice?

807


Explain the selection sort algorithm and state its time complexity?

811


Explain about varargs in java?

874


What is a map in java?

752


What is a treeset class?

757


Can we have try block without catch block?

798


Is class is a data type?

799


How would you use Bubble Sort to sort the number of elements?

814


Is special character in java?

828


What is t type java?

815


How many types of interfaces are there?

774


How are variables stored in memory?

805