nerdexam
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)
  • A
    11% (4)
  • B
    8% (3)
  • C
    3% (1)
  • D
    78% (28)

Community Discussion

No community discussion yet for this question.

Full GSSP-JAVA Practice