Eclipse 中方法的图标是什么意思?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3957321/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What do the icons for methods in Eclipse mean?
提问by Jonas
Possible Duplicate:
What do the icons in Eclipse mean?
可能重复:
Eclipse 中的图标是什么意思?
In the "Package Explorer" in the Eclipse IDE, I can click on a Java class and list all its methods. The methods are displayed with a few different icons before the name, including a green circle or a red square.
在 Eclipse IDE 的“Package Explorer”中,我可以单击一个 Java 类并列出它的所有方法。方法在名称前显示有几个不同的图标,包括绿色圆圈或红色方块。
What do these icons mean? Is there a webpage that explains them?
这些图标是什么意思?有没有解释它们的网页?
回答by mikej
Green circle indicates a public method
绿色圆圈表示公共方法
Red square indicates a private method
红色方块表示私有方法
Yellow diamond indicates a protected method
黄色菱形表示受保护的方法
Blue triangle indicates default (package visible) method
蓝色三角形表示默认(包可见)方法
This pagegives an overview of all the icons used in Eclipse JDT. This pageexplains what the different access levels mean in Java terms, in case you aren't familiar with that.
此页面概述了 Eclipse JDT 中使用的所有图标。此页面解释了不同访问级别在 Java 术语中的含义,以防您不熟悉。
回答by Spike Gronim
Methods with the red square are private and the ones with the green circle are public.
带有红色方块的方法是私有的,带有绿色圆圈的方法是公共的。
http://download.oracle.com/javase/tutorial/java/javaOO/accesscontrol.html
http://download.oracle.com/javase/tutorial/java/javaOO/accesscontrol.html
回答by Protostome
green circle - Usually a public method. red square - private method. yellow - protected
绿色圆圈 - 通常是公共方法。红场 - 私有方法。黄色 - 受保护