Information Technology Reference
In-Depth Information
When a declaration has multiple modifiers, they can be placed in any order, before the
core declaration. So far, I've only discussed two modifiers: public and private . When there are
multiple attributes, they can be placed in any order, before the modifiers. I'll discuss attributes
in Chapter 21.
For example, public and static are both modifiers that can be used together to modify
certain declarations. Since they're both modifiers, they can be placed in either order. The fol-
lowing two lines are equivalent:
public static int MaxVal;
static public int MaxVal;
Figure 6-1 shows the order of the components as applied to the member types shown so
far: fields and methods. Notice that the type of the field and the return type of the method are
not modifiers—they are part of the core declaration.
Figure 6-1. Attributes, modifiers, and core declarations
Search WWH ::




Custom Search