我在这种情况下有一个疑问定制的实现,我已经张贴在这里的一些示例代码....的接口方法
public interface a{
public void m1();
public void m2();
public void m3();
.
.
.
public void m100();
}
public class A implements a{
public void m3(){
// implementation code
}
// Here i need to implement only m3() method but not all 100 methods
//basically i have to implement all the other 99 methods
// but here i don't want to either implement or provide skeleton declarations for all
//remaining.... what should i do for compiling this ????
}
谁能帮助呢?
这正是MouseAdapter,WindowAdapter等为Swing中相应的MouseListener,WindowListener接口所做的事情。 – Rhangaun 2010-05-27 18:17:09
我在一次采访中遇到了这个问题...... – Renuka 2010-05-27 18:19:51
@Renuka面试官想知道,如果你理解了界面和抽象类的区别,以及如何一起使用它们。 – zengr 2010-05-27 18:44:08