Inner and Anonymous Classes

Inner classes and inner interfaces were introduced in JDK 1.1. An inner class (also referred to as a nested class) is a class that is defined as a member of another class or local to a statement block. Inner interfaces are less common than inner classes. They are defined as members of another class or interface.

EXAM TIP

Inner and Anonymous Classes Make sure that you understand how inner and anonymous classes are used. You will see several exam questions that cover inner and anonymous classes.

Inner Classes

When an inner class is defined as a member of another class, it can have the access modifiers (public, protected, private, or package access). It can also be declared as abstract, final, or static. The access modifiers ...

Get Sun Certification Training Guide (310-025, 310-027): Java™ 2 Programmer and Developer Exams now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.