8000 java_lang_specs/final/readme.md at main · HunorVadaszPerhat/java_lang_specs · GitHub
[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 1.09 KB

File metadata and controls

25 lines (20 loc) · 1.09 KB

Final

Final variable

  • final variables are constants
  • once a final variable is initialized the value cannot be changed
  • it is a good practice to name variables with UPPER CASE
  • Blank final variables

    • if a final variable is not initialized at the time of the declaration is known as a blank final variable
    • the blank final variable must be initialized Final variables

Final method

  • final methods CANNOT be overriden by subclass Final methods

  • BUT final methods CAN be called by subclass Final methods call from subclass

Final class

  • final classes cannot be extended by subclass Final class
0