Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

java

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,

  • What is the significance of that little symbol?
  • Why there is different color and shape for different different methods?
  • Does that symbol give any idea about the method?
like image 742
Parth Avatar asked Dec 21 '22 01:12

Parth


2 Answers

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

like image 117
Vlad Ilie Avatar answered May 20 '23 08:05

Vlad Ilie


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

like image 32
alan.sambol Avatar answered May 20 '23 07:05

alan.sambol