1.

In java, which rule must be followed?(a) Keyword private preceding list of private member’s(b) Keyword private with a colon before list of private member’s(c) Keyword private with arrow before each private member(d) Keyword private preceding each private memberI had been asked this question at a job interview.My question is based upon Private Member Functions in division Member Functions & its Types of Object Oriented Programming

Answer»

The correct option is (d) Keyword private preceding each private member

The BEST I can explain: The private keyword must be MENTIONED before each private member. UNLIKE the RULE in C++ to specify private once and LIST all other private member’s, in java all member declarations must be preceded by the keyword private.



Discussion

No Comment Found

Related InterviewSolutions