GIAC
GSSP-JAVA · Question #198
Consider the given lines of codE. package ucert class memberaccess { public int mem = 10; } Which of the following can directly access the variable mem?
The correct answer is D. Any class in the package ucert. See the full explanation below for the reasoning.
Question
Consider the given lines of codE. package ucert class memberaccess { public int mem = 10; } Which of the following can directly access the variable mem?
Options
- AAny class
- BAny class that extends the memberaccess class
- COnly the memberaccess class
- DAny class in the package ucert
How the community answered
(36 responses)- A11% (4)
- B8% (3)
- C3% (1)
- D78% (28)
Community Discussion
No community discussion yet for this question.