Dedian  
          -- 關注搜索引擎的開發
          日歷
          <2006年5月>
          30123456
          78910111213
          14151617181920
          21222324252627
          28293031123
          45678910
          統計
          • 隨筆 - 82
          • 文章 - 2
          • 評論 - 228
          • 引用 - 0

          導航

          常用鏈接

          留言簿(8)

          隨筆分類(45)

          隨筆檔案(82)

          文章檔案(2)

          Java Spaces

          搜索

          •  

          積分與排名

          • 積分 - 66091
          • 排名 - 813

          最新評論

          閱讀排行榜

          評論排行榜

           
          Definition:

          A class within another class

          Example:

          class EnclosingClass 
          {
          ...
          class ANestedClass
          {
          ...
          }
          }

          Purpose:

          Reflect and enforce the relationship between two classes. (esp. in the scenarios that the nested class makes sense only in the context of its enclosing class or when it relies on the enclosing class for its functionthe nested class makes sense only in the context of its enclosing class or when it relies on the enclosing class for its function)

          Interesting features:

          1. An instance of InnerClass can exist only within an instance of EnclosingClass
          2. InnerClass instance has direct access to the instance variables and methods of its enclosing instance.
          3. two special kinds of inner classes: local classes and anonymous classes

          reference:
          http://java.sun.com/docs/books/tutorial/java/javaOO/nested.html
          posted on 2006-05-16 08:22 Dedian 閱讀(330) 評論(0)  編輯  收藏 所屬分類: Java Glossary
           
          Copyright © Dedian Powered by: 博客園 模板提供:滬江博客
          主站蜘蛛池模板: 河北区| 苍梧县| 新化县| 恩平市| 乌拉特中旗| 英超| 石渠县| 杭州市| 天门市| 卢湾区| 东明县| 大足县| 宜君县| 乌兰察布市| 喀喇沁旗| 建湖县| 胶南市| 三门峡市| 井研县| 团风县| 丰都县| 金门县| 平山县| 车险| 桂林市| 化德县| 玛纳斯县| 安达市| 繁昌县| 车险| 郧西县| 隆尧县| 昭平县| 深州市| 襄城县| 哈密市| 茌平县| 自贡市| 金川县| 精河县| 区。|