- Final
- Abstract
- Static
- Strictfp
- Native
- Synchronized
- Transient
Final Non Access Modifiers:
Applicable to :
- Class
- Method
- Instance Variable
- Local Variable
- Method arguments
Final Class :
Once Final non access modifier is applied to Class. Class can not be Extended by any other class.
Example: String Class in java.util package
Final Method :
Once Final non access modifier is applied to Method. That method can not be Overriden in subclass.Example :
Final Variable :
Once Final non access modifier is applied to Variable. That variable’s value can not be Changed once assigned. Final variable are like constants.Example : public static final int i = 10;
Abstract Non Access Modifier
Keyword: abstract
Applied to:
- Class
- Method
Abstract Class:
Abstract class can have(Not compulsary) abstract method. A class can also be an abstract class without having any abstract method in it. But once a class have an abstract method class becomes abstract class.
Abstract Method :
Abstract method are those methods which doesn’t have a body but only specification.Example : public void method();
Synchronized Non Access Modifier
Applied to
- Method(Only)
Synchronized Method
Synchronized method can be accessed by only one thread at a time.
Native Non Access Modifier
Applied to
- Method(Only)
Native Method
Naive method indicates that a method is implemented in platform dependent code.
Strictfp Non Access Modifier
Applied to
- Class
- Method
Strictfp Class / Method
Strictfp non access modifier forces floating point or floating point operation to adhere to IEEE 754 standard.Note*: Strictfp non access modifier cannot be applied to variable.
No comments:
Post a Comment