Java Reference
In-Depth Information
Tutorial: RAD Icons
You may have noticed the various symbols and letters next to Navigation tree items. Each icon describes the item. For
instance, a green circle ( ) represents a public method, whereas an orange square ( ) represents a private method.
Notice in the Outline view (on the far right of the window) that the variables and methods in Employee also have
icons. Can you figure out what a blue triangle with a white center (
) represents? (See the text following step 7
for the answer.)
1.
Click on the beginning of line 5 in the Employee class (i.e., before the String keyword).
2.
Type private and then a space.
The triangle icon changes to a red box with a white circle in the center (
). This new icon represents
a private variable.
3.
After the keyword private , type static and a space.
A red S is added to the icon. This means that the variable is static and can be accessed even if the class is
not instantiated as an object.
4.
Delete the keyword private.
The blue triangle is displayed and the red S remains.
5.
Type the word final and a space before static.
A blue F is added to the icon after the red S to represent that this variable is unchangeable (more on final later).
6.
Replace the keywords final and static with public .
The icon changes to a green circle with a white center.
7. Replace the keyword public with protected .
protected is in between private and public . Protected allows access to subclasses or classes within the same
package. The blue triangle represents an access of default (or none). When no modifier is specified, access is restricted
to classes within the same package.
There are couple of other RAD icons you should be familiar with. Notice that a constructor is indicated with a
green C ( ) and a package has a black plus sign (+) superimposed over a square ( ). The plus sign is the “ribbon/
string” on the package icon. (Get it?). The color of the square changes depending on the view and its contents. Notice
that myFirstPackage's box is gray in the Outline view but golden in the navigation tree. In addition, if the package is
empty, the box will be white.
Lastly, a class header is indicated with a green circle with a white C in the center ( ), see Employee in the outline
view) and the class file, which holds bytecode, is indicated with a white piece of paper with a blue J, zeros, and
a one (
), see the icon next to String.class item in the navigation window.)
8.
Change the size of the source code pane so that it only displays 10 lines (see Figure 2-18 ).
 
Search WWH ::




Custom Search