实现该方法时,是否有任何方法可以包含接口名称 [英] Is there any way to include the name of the interface when implementing the method
本文介绍了实现该方法时,是否有任何方法可以包含接口名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在实现该方法时,是否有任何方法可以包含接口名称?如果我必须实现3个接口,那么很难提醒我实现的方法来自何处.
Is there any way to include the name of the interface when implementing the method? If I have to implement 3 interfaces, then it would be hard to remind me where the implemented method comes from.
如果我需要2个接口来实现相同的方法名.我怎么知道我正在执行哪种方法?
If I have 2 interface required to implement the same method name. How can I tell which method I am implementing?
public interface BarInt {
void method();
}
public interface GeeInt{
void method();
}
public class Foo implements BarInt, GeeInt{
@Override
public void method() {
// TODO Auto-generated method stub
}
}
谢谢
推荐答案
是的,您只能使用@see
javadoc注释
Yes, you can just use a @see
javadoc comment
public interface BarInt {
void method();
}
public class Foo implements BarInt{
/**
* @see BarInt#method()
*/
@Override
public void method() {
// TODO Auto-generated method stub
}
}
这篇关于实现该方法时,是否有任何方法可以包含接口名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文