VIRGIN FOREST OF JAVA
不要埋头苦干,要学习,学习,再学习。。。。。
powered by R.Zeus
if you want to use abstract class or interface as new instance and don't want to create a class that extends abtract class or implements interface ,you can do like this:

interface=new interface(or abtract class)
{
//in this rigion ,implements all the method needed(e.g. abstract method,method in interface)
.......
}

this use in the case that one interface has many implements which  just be used once ,so this way is a lazy but good way.

this way called "Anonymous class";
posted on 2006-09-28 12:29 R.Zeus 阅读(376) 评论(0)  编辑  收藏 所属分类: J2SE

只有注册用户登录后才能发表评论。


网站导航: