gpt4 book ai didi

java - 在 eclipse 中按实现类搜索

转载 作者:行者123 更新时间:2023-11-29 09:34:48 31 4
gpt4 key购买 nike

是否可以通过 eclipse 中的实现或其方法进行搜索?这真的很有用。下面给出了一个例子。

public interface Foo {
public void method();
}

public class FooImpl implements Foo {
// I should be able to select this and search and it should
// show the whoever called Foo.method
public void method() {

}
}

最佳答案

如果您看到一个从接口(interface)调用的方法,则只需将鼠标光标放在它上面,按 ctrl 键,您就会看到带有选项“Open Declaration | Open Implementation”的菜单。在您的情况下,请按“打开实现”。如果此方法由许多类实现,您将看到一个弹出窗口,其中包含“Types implementing or defining...”。相当不错的功能:)

更新:根据您的示例...如果我理解正确,那么当您选择方法时,按 ctrl+shift+G,您会看到所有调用此方法的地方。

关于java - 在 eclipse 中按实现类搜索,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4612703/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com