48

Possible Duplicate:
What do the icons in Eclipse mean?

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.

What do these icons mean? Is there a webpage that explains them?

Community
  • 1
  • 1
Jonas
  • 121,568
  • 97
  • 310
  • 388

3 Answers3

137

green circleGreen circle indicates a public method

red squareRed square indicates a private method

alt textYellow diamond indicates a protected method

alt textBlue triangle indicates default (package visible) method

This page gives an overview of all the icons used in Eclipse JDT. This page explains what the different access levels mean in Java terms, in case you aren't familiar with that.

mikej
  • 65,295
  • 17
  • 152
  • 131
  • 13
    +1 for the embedded icons :-) – tsimbalar Oct 18 '10 at 08:15
  • How does Eclipse label those classes that have a `main` method? – KareemJ May 10 '19 at 08:22
  • 1
    @KareemJeiroudi these are labelled with a small green "run" arrow overlaid on the class's icon. In the [icon reference linked above](https://help.eclipse.org/2019-03/index.jsp?topic=/org.eclipse.jdt.doc.user/reference/ref-icons.htm) you can see what this looks like under *type with public static void main(String[] args)* – mikej May 13 '19 at 21:06
1

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

Spike Gronim
  • 6,154
  • 22
  • 21
1

green circle - Usually a public method. red square - private method. yellow - protected

Protostome
  • 5,569
  • 5
  • 30
  • 45