[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

JAVA Programming :: Objects and Classes - Discussion

Home > JAVA Programming > Objects and Classes > MCQs Questions Discussion

11 / 30

To make a variable defined in a class accessible only to methods defined in the classes in same package, which of the following keyword should be used. Select the one correct answer.

ABy using the keyword private before the variable.

BBy using the keyword protected before the variable.

CBy using the keyword public before the variable.

DThe variable should not be preceded by any of the above mentioned keywords.

Answer: Option (Login/Signup)

Show Explanation

Asked In :: Virtusa

Post Your Answer Here:     

No Discussion on this question yet!