About interface and inner class
来源:互联网 发布:杀破狼 js主唱去世 编辑:程序博客网 时间:2024/06/05 13:21
Interface is a protocol for implementors and users. So itcan be used to implement callback function which is wildly used in many otherareas. The interface is much more powerful than class or abstract class. Interfacescan be inherited and extended. A class can inherit multiple interfaces.
Inner class gives us convenience to have more than oneimplementation of an interface in a class. This is pretty useful in some caseswhen you need to have multiple implementation of some interface or callback.Event handlers in GUI, for instance, take a lot advantage of anonymous class. Thatis also the place in which we use inner class most.
Although they provide use more options and more powerfulsolutions, interfaces and inner class should be considered in design phase. Inappropriateusage of them could cause serious problems in implementation phase andmaintenance phase. We should learn when and where to use, rather than how touse them. Also, we should learn to use them to improve our solutions notcausing new problems.
- About interface and inner class
- 接口和内部类( interface and inner class)
- Java inner class and anonymous inner class
- class and interface
- Interface And Abstract Class
- Interface and abstract class
- Abstract class and Interface
- Abstract Class And Interface
- interface and abstract class
- Trivial_1_abstract class and interface
- Abstract class and interface
- Java Interface and Class Hierarchy
- effective java -Class and Interface
- Interface and Abstract Class 区别
- java interface and abstract class
- Java-Abstract Class and Interface
- Java学习--Interface, inner class, anonymous inner class, lambda实例比较
- Explaination for Class, Abstract Class and Interface
- MSVC vs. MinGW 之 (lib,dll,def,obj,exe) vs (a,dll,def,o,exe)
- OSG世界坐标转屏幕坐标
- 小强升职记中四象限
- About OOP: object-oriented programming
- 破解网页右键被锁小技巧
- About interface and inner class
- 域名相关知识
- 最近的一些进展
- 关于SQL2005安装失败的一种可行性解决办法
- 二分排序
- 读马加爵绝信后感
- IE和火狐的不兼容
- 快速排序
- 中国象棋(一)