Final Keyword
By – Namrata Thakare
What is Final Keyword in Java.. ?
• In the Java Programming Language, the final
Keyword is used in several different conte...
Final Variables
• Any variable referenced as final is called Final
variable.
• Blank Final Variable.
• Final variables are...
Difference between const & Final
• The state of array declared as final can be modified in
Java.
• But Same is not possibl...
Final Methods
• Final method can not be overridden in sub-class.
• In methods private is equal to final, but in variables ...
Final Classes
• Final class is complete in nature and can not be sub-
classed or inherited.
• Final and abstract are two o...
Benefits of Final keyword
• Final keyword improves performance.
• It lets other programmers know that this variable
should...
THANK YOU
Upcoming SlideShare
Loading in …5
×

Final keyword

396 views

Published on

Published in: Technology, News & Politics
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
396
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
22
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Final keyword

  1. 1. Final Keyword By – Namrata Thakare
  2. 2. What is Final Keyword in Java.. ? • In the Java Programming Language, the final Keyword is used in several different contexts to define an entity which cannot later be changed.
  3. 3. Final Variables • Any variable referenced as final is called Final variable. • Blank Final Variable. • Final variables are by default read only.
  4. 4. Difference between const & Final • The state of array declared as final can be modified in Java. • But Same is not possible in C / C++.
  5. 5. Final Methods • Final method can not be overridden in sub-class. • In methods private is equal to final, but in variables it is not.
  6. 6. Final Classes • Final class is complete in nature and can not be sub- classed or inherited. • Final and abstract are two opposite keyword and a final class can not be abstract in Java.
  7. 7. Benefits of Final keyword • Final keyword improves performance. • It lets other programmers know that this variable shouldn't be changed or assigned another value • It stops you accidentally changing the value. • It stops people overriding methods when you don't want them to or they shouldn't.
  8. 8. THANK YOU

×