Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Abstract class VS final class?  RSS feed

 
abalfazl hossein
Ranch Hand
Posts: 635
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the usage of final class?
 
fred rosenberger
lowercase baba
Bartender
Posts: 12542
48
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A final class cannot be extended. It lets you maintain control of your class, preventing someone from making a subclass that doesn't do what you want. The String class is a common example of a final class.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!