image

CHAPTER

7

Nested Classes

imagen the previous chapter we covered the use of static fields, methods, and initializers. You learned an important feature of Java language—the interfaces. In this chapter, you will learn another powerful feature of classes—that is, nested or inner classes. As the name suggests, you can embed a class declaration within another class. This gives you the power to hide your classes within an outer class. Embedding a class within another class has many more repercussions than simply hiding it from the outside world. An inner class ...

Get Java Programming 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.