1.

If a function in java is declared private then it __________________(a) Can’t access the standard output(b) Can access the standard output(c) Can’t access any output stream(d) Can access only the output streamsI had been asked this question in final exam.Origin of the question is Private Member Functions in portion Member Functions & its Types of Object Oriented Programming

Answer»

The CORRECT answer is (b) Can access the standard OUTPUT

To EXPLAIN I would say: The private MEMBERS can access any standard input or output. There is no restriction on access to any input or output stream. And since standard input can also be USED hence only accessing the output stream is not true.



Discussion

No Comment Found

Related InterviewSolutions