LearnFrenzy
Sign in Take a free test

Classes and Objects · Classes and Objects MCQ · Question 15

Creating an inner-class object Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
Question 15 Back to Exercise

Outer has a non-static inner class Inner. How do you create an Inner from static code?

  • A new Inner()
  • B outerObject.new Inner() Correct
  • C Inner.create()
  • D It is impossible
Correct Answer: Option B

Each Inner object is tied to an Outer object whose fields it can use.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links