In the "Package Explorer" in Eclipse, I can click on a Java class and list all the methods for it. The methods are shown with a few different symbols before the name. This symbol can be a green circle or a red square. What does this symbols mean? Is there a webpage that explains them?
+4
A:
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 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
2010-10-18 07:46:53
there is one more for package-private, right? Blue triangle?
Thilo
2010-10-18 07:55:05
@Jonas I spotted the link I'd included was actually the page for C++ outline view within Eclipse - that's why I took it out. I've added the right page for Java now.
mikej
2010-10-18 07:58:03
@Thilo thanks I've added that one too.
mikej
2010-10-18 08:07:26
+1 for the embedded icons :-)
tsimbalar
2010-10-18 08:15:13
A:
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
2010-10-18 07:47:24
A:
green circle - Usually a public method. red square - private method. yellow - protected
Protostome
2010-10-18 07:47:58