I am a new user to Intellij. I have a hierarchy where both ClassA and ClassB implement foo() in MyInterface:
public interface MyInterface{
void foo()
}
public class ClassA implements MyInterface{
@Override
public void foo(){
System.out.println("Hello");
}
}
public class ClassB implements MyInterface{
@Override
public void foo(){
System.out.println("World");
}
}
public class HelloWorld {
public static void main(String[] args){
new ClassA().foo();
new ClassB().foo();
}
}
When I do Find Usages on the foo() definition in ClassA, both the foo() from ClassA and ClassB are found. Is there a way to only have the foo() called on the ClassA instance found?
You can search for usages of only ClassA:
Also you can restrict usages scope to certain files in project (including creating your custom scope):
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.