Java Learning Note – inner class(2)
来源:互联网 发布:淘宝已买到宝贝打不开 编辑:程序博客网 时间:2024/05/29 17:16
Java Learning Note – inner class(2)
Reference: Java Tutorial (Oracle)
Meaning
Characters
Inner
class
help the outer class to realize some function
(ex. iterator of Array)
1.inner class can be viewed as a member of an instance outer class, hence, it must depend on an instance. (no static allowed)
2.inner class method with be covered by the outer class same name method.
(use this.field to access inner class members, andOuterClass.this.field to access outer class members)
3.it can realize a interface, the outer class return such an interface.(???)
Static inner class
same as static class member
1.it can only access static outer member
2. have no illustration to outer class
Local inner class
class in a block
1.it can access final variables in the method where it was stated
( because local inner class will die when the method finished)
Anonymous inner class
1. used when an instance of class is needed
- Java Learning Note – inner class(2)
- Java Learning Note –class(1)
- Java inner class and anonymous inner class
- java inner class
- java inner class
- Java Inner Class
- Java Inner Class
- Java Inner Class Intruduction
- Java Inner Class 整理
- Java Inner Class
- java inner class
- Java inner class
- Java Inner Class
- Java Inner Class
- Angrew. NG, Machine Learning, Class Note
- Java內隐类(Java Inner Class)
- inner class(2)
- think in java&Inner Class
- 在一张表中,而不在另一张表中的记录
- grub2详解
- 【bzoj4094】[Usaco2013 Dec]Optimal Milking 线段树
- 初学QT笔记: 多个QLineEdit之间的焦点设置、切换、获取
- Hibernate的抓取策略
- Java Learning Note – inner class(2)
- 安装 Python2.7到 centos
- list.add数据覆盖的问题
- eclipse断点调试快捷键
- Hyperbolic Discounting(双曲贴现)
- linux下设置tomcat脚本启动
- SAP数据更新
- build.xml:278: Unable to find a javac compiler;
- Android系统自带样式(android:theme)(转)