Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- what final keyword do in java and how to use it
- final classes
- ---
- any class that defines final will not be subclassed.
- you can not extends any class from a final class.
- final methods
- ---
- any method that defines final will not be overriden.
- you can not override final methods.
- final variables
- ---
- final variables initiated only once.
- if you define setter for a final variable, you will get a compile time error from the compiler.
Add Comment
Please, Sign In to add comment