Sail E0 Webinar

MCQs

Total Questions : 51 | Page 6 of 6 pages
Question 51.

Which of these access specifiers must be used for main() method?


  1.    private
  2.    public
  3.    protected
  4.    None of the mentioned
 Discuss Question
Answer: Option B. -> public

main() method must be specified public as it called by Java run time system, outside of the program. 

If no access specifier is used then by default member is public within its own package & cannot be 

accessed by Java run time system.


Latest Videos

Latest Test Papers