Guest User

Untitled

a guest
Feb 25th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. what final keyword do in java and how to use it
  2.  
  3. final classes
  4. ---
  5. any class that defines final will not be subclassed.
  6.  
  7. you can not extends any class from a final class.
  8.  
  9.  
  10. final methods
  11. ---
  12. any method that defines final will not be overriden.
  13.  
  14. you can not override final methods.
  15.  
  16.  
  17. final variables
  18. ---
  19. final variables initiated only once.
  20.  
  21. 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