What is Inner class in Java? - tccicomputercoaching.com

Page 1

What is Inner class in Java? tccicomputercoaching.com Inner class means one class inside another class or we can say that one class is member of another class.

Such class is known as nested class. Syntax: class OuterClass { // ... class NestedClass { // ... } } How to access inner class? To access the inner class, create an object of the outer class, and then create an object of the inner class.

There are basically four types of inner classes in java. 1) Nested Inner class 2) Method Local inner classes


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.