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
2) Red square shape symbol
3) Yellow diamond shape symbol
So,
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
Red square means the method is private. Yellow diamond means the method is protected. Green circle means the method is public.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With