This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes final class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "final class" Watch "final class" New topic

final class

Praveena khandavalli

Joined: Jan 05, 2002
Posts: 21
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
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
In order to override you would have to be writing a subclass - impossible with a class declared final.
Praveena khandavalli

Joined: Jan 05, 2002
Posts: 21
thanx william
Jason Kretzer
Ranch Hand

Joined: May 31, 2001
Posts: 280
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 ]

Jason R. Kretzer<br />Software Engineer<br />System Administrator<br /><a href="" target="_blank" rel="nofollow"></a>
Jose Botella
Ranch Hand

Joined: Jul 03, 2001
Posts: 2120
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 ]

SCJP2. Please Indent your code using UBB Code
I agree. Here's the link:
subject: final class
It's not a secret anymore!