We've expanded our news coverage and improved our search! Visit news.oreilly.com for the latest or search for all things across O'Reilly!
advertisement

Article:
  Nested Classes, Part 1
Subject:   static inner class
Date:   2004-06-21 06:41:15
From:   pzikos
i understand the concept of inner classes and i have used them a lot in my programs. yet why would somebody declare a static inner class and not create another class?
Full Threads Oldest First

Showing messages 1 through 1 of 1.

  • static inner class
    2004-06-21 07:11:08  Robert Simmons Jr. (Kraythe) [Reply | View]

    Oh, that is easy. Compositional relationships. For example, consider an entry in a Hashtable. The entry itself cannot exist outside of the hashtable. Nor is there any reason for users of the table to access the class. Therefore, a private static nexted class is the perfect answer.