Parth
Parth

Reputation: 141

What are those different color symbols when we mouseover on methods in eclipse?

Suppose you have a method which returning some object. So, when you hover over that method used in some other class, eclipse show you a popup with the description about that method signature and what that method would return.

But, my question is there is a little symbol ahead of what is being return. On different occasion you got different shape and color symbol.

I have a screen shots of that:

1) Green circle shape symbol

Green circle shape symbol

2) Red square shape symbol

Red square shape symbol

3) Yellow diamond shape symbol

Yellow diamond shape symbol

So,

Upvotes: 4

Views: 6091

Answers (3)

Vlad Ilie
Vlad Ilie

Reputation: 1409

The symbols next to the methods refer to the access modifiers

  • What is the significance of that little symbol?
    Green circle is public
    Red square means private
    Yellow diamond is protected
    Blue triangle means default(package) access

  • Does that symbol give us any idea about the method?
    Yes, it tells us where it can be accessed from. For more on access modifiers: http://docs.oracle.com/javase/tutorial/java/javaOO/accesscontrol.html

Upvotes: 9

Rene M.
Rene M.

Reputation: 2690

That are the same symbols as you see all over the IDE. Which present the visibility of the element inside your app.

The visibility of an element in a java application can be:

  1. Private: Red square
  2. Protexted: Yellow diamond
  3. Public: Green circle

Upvotes: 1

alan.sambol
alan.sambol

Reputation: 265

Red square means the method is private. Yellow diamond means the method is protected. Green circle means the method is public.

Upvotes: 3

Related Questions