1.

Which among these access specifiers should be used for main() method?(a) private(b) public(c) protected(d) none of the mentionedThe question was asked in class test.My enquiry is from Accessor controls of class in portion Miscellaneous topics of C#

Answer»

Correct choice is (b) public

To explain I would SAY: MAIN() method must be specified public as it called by Csharp run time SYSTEM outside of the program, by DEFAULT main is private in nature if no access specifier is used.



Discussion

No Comment Found

Related InterviewSolutions