朋友们,我在 Java 中遇到了一个问题:我想实现一个结构,但我在做这件事时遇到了一些困难,谁能帮助我。
interface samp1{
method1()
method2()
method3()
}
interface samp2{
method4()
method5()
}
class Samp implements samp1,samp2
{
// this class needs only method1 from interface samp1 and method 4 from interface samp2
// I don't want to override all the methods from interface
}
任何人都可以为此提出一些解决方案吗?
有没有可用的设计模式?如果是这样,请提供参考链接。
提前致谢。