Copyright

Inner Classes in Java: Definition & Example

Instructions:

Choose an answer and hit 'next'. You will receive your score and answers at the end.

question 1 of 3

In the following code, what is the name of the inner class?

Create Your Account To Take This Quiz

As a member, you'll also get unlimited access to over 79,000 lessons in math, English, science, history, and more. Plus, get practice tests, quizzes, and personalized coaching to help you succeed.

Try it risk-free
Try it risk-free for 30 days. Cancel anytime
Already registered? Log in here for access

1. Examine the following code. What type of class is ProductCode?

2. Examine the following code: Which of the following correctly creates an instance of both the Product and the ProductDetail (a non-static inner) class?

Create your account to access this entire worksheet
A Premium account gives you access to all lesson, practice exams, quizzes & worksheets
Access to all video lessons
Quizzes, practice exams & worksheets
Certificate of Completion
Access to instructors
Create an account to get started Create Account

About This Quiz & Worksheet

To pass this quiz, you'll need to be familiar with inner classes in Java. The quiz includes four multiple-choice questions, and you can take it several times.

Quiz & Worksheet Goals

You'll be tested on the following topics:

  • Name of the inner class in a specified code
  • Type of class in a specified code
  • Identifying which code creates a non-static inner class
  • Correct way to get to methods inside the static class

Skills Practiced

  • Knowledge application - use your knowledge to answer questions about the inner class in a specified code
  • Information recall - access the knowledge you've gained regarding the type of class in a specified code
  • Interpreting information - verify that you can read information regarding which code creates a non-static inner class and interpret it correctly

Additional Learning

Further your understanding of this topic with a related lesson titled Inner Classes in Java: Definition & Example. Here are some of the topics you'll find in this lesson:

  • Concept of encapsulation
  • How an outer/inner class looks in Java
  • Nested/inner class shadows
  • Static nested class
Support