Why nested class?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ryan Stewart

    Why nested class?

    Why would you use a static nested class? If it can basically be treated and
    instantiated just like a top-level class, what's the point?


  • Adam Maass

    #2
    Re: Why nested class?


    "Ryan Stewart" <zaphod@no.texa s.spam.net> wrote:[color=blue]
    > Why would you use a static nested class? If it can basically be treated[/color]
    and[color=blue]
    > instantiated just like a top-level class, what's the point?
    >[/color]

    The nested class doesn't have to be public; maybe only the enclosing class
    instantiates instances of it.

    The construct might be useful to instantiate a class to implement an
    interface, ala Map.entrySet() .


    -- Adam Maass


    Comment

    Working...