1.

The function main() must always be public.(a) True(b) FalseI have been asked this question in semester exam.Enquiry is from Public Member Functions topic in chapter Member Functions & its Types of Object Oriented Programming

Answer»

Right choice is (a) True

To explain: The main() function MUST always be public. This is because the whole function and the OPERATING system that is out of the PACKAGE have to access the main function throughout the program EXECUTION. Hence the main() function should be public so as to be available everywhere in the program.



Discussion

No Comment Found

Related InterviewSolutions