What are these different color characters when hovering over methods in eclipse?

Suppose you have a method that returns an object. Thus, when you hover over this method used in some other class, eclipse shows you a pop-up window with a description of this method signature and the method returned.

But, my question is that before that comes back, there is a small symbol . At different times, you received different symbols of shape and color.

I have screenshots:

1) Green circle shape symbol

Green circle shape symbol

2) The symbol of the red square

Red square shape symbol

3) A symbol of the shape of a yellow diamond

Yellow diamond shape symbol

So,

  • What is the meaning of this little symbol?
  • Why are there different colors and shapes for different methods?
  • Does this symbol represent any idea of ​​a method?
+4
source share
3 answers

Symbols next to methods refer to access modifiers

  • What is the meaning of this little symbol?
    The green circle is public
    Red square means private
    Yellow diamond protected
    Blue triangle means default access (package)

  • Does this symbol represent any idea of ​​a method?
    Yes, this tells us what you can access from. Additional information about access modifiers: http://docs.oracle.com/javase/tutorial/java/javaOO/accesscontrol.html

+7
source

A red square means that the method is closed. A yellow diamond means that the method is protected. A green circle means that the method is publicly available.

+3
source

These are the same characters as in the entire IDE. Which represents the visibility of an element within your application.

An element visibility in a Java application can be:

  • Private: Red Square
  • Protected: yellow diamond
  • Publication: Green Circle
0
source

Source: https://habr.com/ru/post/1497414/


All Articles