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

          導航

          常用鏈接

          留言簿(8)

          隨筆分類(45)

          隨筆檔案(82)

          文章檔案(2)

          Java Spaces

          搜索

          •  

          積分與排名

          • 積分 - 65551
          • 排名 - 817

          最新評論

          閱讀排行榜

          評論排行榜

           
          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 閱讀(325) 評論(0)  編輯  收藏 所屬分類: Java Glossary
           
          Copyright © Dedian Powered by: 博客園 模板提供:滬江博客
          主站蜘蛛池模板: 敦化市| 雅江县| 庄浪县| 晋江市| 策勒县| 乌拉特后旗| 宿松县| 公主岭市| 新兴县| 罗定市| 内乡县| 巩义市| 台州市| 固原市| 安岳县| 台安县| 亚东县| 诸暨市| 敦煌市| 嫩江县| 涿鹿县| 西华县| 清水县| 赣榆县| 庆云县| 车致| 桦甸市| 新昌县| 连城县| 徐汇区| 金寨县| 桐柏县| 明溪县| 嘉善县| 海城市| 科尔| 海南省| 栾川县| 新巴尔虎左旗| 南昌县| 兴海县|