1. Create an inner class.
  2. Create an object of inner class.
  3. Access class members of inner class.
  4. Identify the inner class by reading the name of .class file.

Create and Access Inner Class in JAVA Video Tutorial (Hindi)

Vineet Agrawal

Published on January 5, 2017

1. Inner class comes under the scope of another class.
2. Syntax of object declaration of inner class is


3. Syntax of instantiation of inner class object is

new <Outer Class Constructor>. new <Inner Class Constructor>

4. Name of .class file of inner class is like


Source code used in the program

class outer
void display()
class inner
void display()
System.out.println("Inner class");
public static void main(String args[])
outer o = new outer();
outer.inner in = new outer().new inner();
This content is part of the following course: 
Frequently Asked Questions
Required Components