If you have already register Login here.
Java Modifiers / Java Modifiers Types
Modifiers are keywords that you add to those definitions to change their meanings. Java language has a wide variety of modifiers, including the following −
To use a modifier, you include its keyword in the definition of a class, method, or variable. The modifier precedes the rest of the statement, as in the following example.
public class className {
// ...
}
private boolean myFlag;
static final double weeks = 8.5;
protected static final int BOXWIDTH = 42;
public static void main(String[] arguments) {
// body of method
}
Java provides a number of access modifiers to set access levels for classes, variables, methods and constructors. The four access levels are −
Java provides a number of non-access modifiers to achieve many other functionality.
© 2025 Easy To Learning. All Rights Reserved | Design by Easy To Learning