简体   繁体   English

如何轻松区分具有不同名称的同名变量

[英]How to easily differentiate variables with the same name from different classes

I have been searching on my workspace in Eclipse. 我一直在Eclipse中搜索我的工作区。 One of the variables declared in ClassA is: ClassA中声明的变量之一是:

private String type = null;

type is such a common name, so there are probably several variables in different classes throughout different projects in the whole workspace called "type" (some of same data type and some of different data types). type是一个通用名称,因此在整个工作空间的整个项目中,不同的类中可能有多个变量,称为“类型”(某些数据类型相同,而某些数据类型不同)。

Other than the view Call Hierarchy , how can I see the different files where this particular "type" variable from ClassA is used when I do Search -> File? 除了视图Call Hierarchy之外 ,在执行“搜索”->“文件”时,如何查看使用ClassA的特定“类型”变量的其他文件?

If you are searching within your project for all references to the variable of a specific class, the IDE should have a built in feature to find all references to that variable. 如果要在项目中搜索对特定类变量的所有引用,则IDE应该具有内置功能来查找对该变量的所有引用。 I know in IntelliJ I can do that. 我知道在IntelliJ中我可以做到。 Not positive on how in Eclipse you'd do that. 对于如何在Eclipse中执行此操作并不满意。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从不同的类中复制同名的成员变量。 (在 JAVA 中) - How to copy member variables of the same name from different classes. (in JAVA) 如何获得 Swagger 以区分顶级与具有相同名称的嵌套类 - How to get Swagger to differentiate top-level from nested classes having the same name 如何从静态方法轻松访问类的各种实例中的变量 - How to easily access variables in various instances of classes from static methods 如何在 spring 引导中区分具有相同名称但不同查询参数的 edpoint - How to differentiate edpoints with the same name but different query params in spring boot 编译器如何区分从不同实例化创建的相同变量 - How does compilers differentiate same variable created from different instantiations 从相同名称的包中引用相同名称的不同类 - Referring different classes of same name from packages of same name 如何对不同的类使用相同的变量名 - How to use same variable name for different classes 如何切换具有相同名称和不同名称空间的类? - How to switch classes with same name and different namespaces? 不同类中的两个相同变量 - Two of the same variables in different classes Java:如何在从不同类实例化的不同对象中调用具有相同名称的方法? - Java : how to call methods with the same name in different objects instantiated from different classes?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM