This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "final class" Watch "final class" New topic
Author

final class

srinivas bolloju
Ranch Hand

Joined: Jan 23, 2001
Posts: 112
hi,
1)final methods are not overridden.
2)A final class makes all of its methods final as well.
1) is understood.
2)is this implicit to us, pls let me know what it really means. i have written to myself a program in which class is final and it has a non-final method, if the 2) is right, how will i now that method a() became final.

Eg. Of final classes : Integer,Float,Long,Double,String in java.lang
Integer is a final class in java.lang, but i see its some of its method, they are not final..
public static int parseInt(String s,
int radix)
throws NumberFormatException
public byte byteValue()
public int hashCode()

please use the [code][/code] tags when showing code. visit <a href="http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=ubb_code_page" target="_blank" rel="nofollow">http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=ubb_code_page</a> ,for more details
Amir Ghahrai
Ranch Hand

Joined: Jun 19, 2002
Posts: 110
srinivas,
When you declare a class as final, it implicitly makes its methods final. a final class cannot be sub classed, therefore, you cannot override it's methods and so by definition, the methods are implicitly final.


Amir
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: final class
 
Similar Threads
Some conflicting points
Method Resolution
Switch statement/case restrictions
Initializers...
How to remove duplicate from ArrayList?