• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

final class

 
Praveena khandavalli
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the following statement is true...but how?
can anyone explain please
all methods declared in a final class are implicitly final and hence cannot be
overridden.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In order to override you would have to be writing a subclass - impossible with a class declared final.
 
Praveena khandavalli
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx william
 
Jason Kretzer
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The final keyword ALWAYS makes things immutable once they have been declared and initialized. At least that is what I have read so far. Are there any exceptions?
[ January 09, 2002: Message edited by: Jason Kretzer ]
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a little trap for those programmers expecting that final static fields are unique in a class. If the same class is loaded several times by diferent class loaders in diferent name spaces, there would be several copies of those fields.
A bit off topic though. Just mentioned for you to consider in the future
[ January 09, 2002: Message edited by: Jose Botella ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic