如题,搜索了下坛子里内部类的帖子,没看出来在实际使用上内部类一般可用于常用的哪方面,有点郁闷,特请教下?
解决方案 »
- java 打包exe文件内存溢出
- 请问如何在某个JDialog窗口重新被激活时执行动作(就是问,应该是WindowListener哪种事件起作用?)
- Java替换类似这样的字符串为空格?
- 虚拟主机的域名怎么用socket?
- 谁有《算法设计技巧与分析》沙特 这本书的习题答案
- 郁闷得要自杀呀,这到底是怎么一回事啊。请好心人救救我,给我口气吧。
- 有关java编程思想的几个问题(1)
- 实时消息管理请教?
- 如何让JTable的列不能移动交换?????????
- 请问在JLIST的渲染器单元中可不以监听鼠标事件(不好意思,最多只能给100分)
- JDBC实现分页
- 如何在jTable一行中填加JButton?
2.In a single outer class you can have several inner classes, each of which implement the same interface or inherit from the same class in a different way. 3.The point of creation of the inner class object is not tied to the creation of the outer class object.
4.There is no potentially confusing “is-a” relationship with the inner class; it’s a separate entity.
也可以定义一个函数对象来开展一个任务,比如java.util.TimerTask经常做一个匿名内部类。
也可以模拟多重继承
可以隐藏实现细节其他还有些,用得少