GIAC
GSSP-JAVA · Question #156
Which of the following instantiation code will you use to create an instance of the inner class SunAssociate, which is written inside the Developer outer class?
The correct answer is D. SunAssociate iterator = this.new SunAssociate(). See the full explanation below for the reasoning.
Question
Which of the following instantiation code will you use to create an instance of the inner class SunAssociate, which is written inside the Developer outer class?
Options
- ASunAssociate iterator = new SunAssociate();
- BDeveloper.SunAssociate;
- CSunAssociate.Developer NestedObject = new SunAssociate. Developer();
- DSunAssociate iterator = this.new SunAssociate();
How the community answered
(35 responses)- A9% (3)
- B17% (6)
- C3% (1)
- D71% (25)
Community Discussion
No community discussion yet for this question.