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: 博客園 模板提供:滬江博客
          主站蜘蛛池模板: 利辛县| 宜良县| 晋江市| 铜川市| 唐河县| 安达市| 新蔡县| 义乌市| 九江县| 龙游县| 永和县| 兴和县| 东台市| 北辰区| 阜新市| 图木舒克市| 申扎县| 高州市| 长岛县| 南京市| 武乡县| 伊宁市| 浪卡子县| 景泰县| 京山县| 从化市| 清原| 淄博市| 玛纳斯县| 东平县| 彰化县| 齐齐哈尔市| 合水县| 门源| 昆山市| 抚州市| 新蔡县| 长岛县| 资溪县| 姜堰市| 灵寿县|