Witscale Test Center

3.1 Overview of modifiers


3.1 Overview of modifiers

In part-I, we saw how a Java class is composed of several smaller constructs such as the class’s member methods, member variables, the free-floating code blocks. A class can also have another class defined inside its body[****]. You can impose different types of restrictions on a class or any of these constructs. For example, you can impose-:

         Access-specific restrictions to indicate who can access a particular construct

         Implementation–specific restrictions to specify how a particular construct would be implemented

         Storage-specific restrictions to specify how a particular construct is stored

Java provides modifier tags that you can use to denote these restrictions. For simplicity, we will categorize the modifier tags as access modifiers and the other modifiers. Access modifiers specify the access-specific restrictions and remaining (other) modifiers specify the implementation and storage-specific restrictions. Let us quickly overview these two kinds of modifiers first. Later (from section 3.2 onwards) we will discuss each modifier and the implications of using it.