nerdexam
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)
  • A
    9% (3)
  • B
    17% (6)
  • C
    3% (1)
  • D
    71% (25)

Community Discussion

No community discussion yet for this question.

Full GSSP-JAVA Practice