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: 博客園 模板提供:滬江博客
          主站蜘蛛池模板: 天气| 沙坪坝区| 腾冲县| 定南县| 上虞市| 佛教| 永泰县| 河间市| 正阳县| 荣成市| 灌阳县| 上蔡县| 红安县| 潞西市| 剑阁县| 潜江市| 太仓市| 塔城市| 彭州市| 商城县| 镇宁| 英山县| 西安市| 罗田县| 天津市| 来凤县| 镇宁| 聊城市| 甘肃省| 南平市| 青神县| 新营市| 鄂州市| 宕昌县| 赣榆县| 安达市| 玉山县| 沅江市| 金沙县| 开阳县| 蓝田县|