朋友们,我在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
}
Run Code Online (Sandbox Code Playgroud)
谁能为此提出一些解决方案?
有没有可用的设计模式?如果是,请提供参考链接.
提前致谢.