GIAC
GSSP-JAVA · Question #92
You work as a Software Developer for TechnoZen Inc. You create an application using Java. You define a method, named myMethod. You also define a class, named myClass, within myMethod. Which of the…
The correct answer is A. myClass can access only final variables. See the full explanation below for the reasoning.
Question
You work as a Software Developer for TechnoZen Inc. You create an application using Java. You define a method, named myMethod. You also define a class, named myClass, within myMethod. Which of the following rules governs the access to the variables of the enclosing method?
Options
- AmyClass can access only final variables.
- BmyClass can access only static variables.
- CmyClass can access only transient variables.
- DmyClass can access any variable.
How the community answered
(19 responses)- A84% (16)
- B11% (2)
- D5% (1)
Community Discussion
No community discussion yet for this question.