if u wanna class that should not be extened we can use final class.no is not draw back of oo but is nothing but encapsulation that is going to hide information.
if i am wrong please inform me
Neha
Dec 20th, 2006
to add to above:String class is also final
Deepak Sharma
Dec 21st, 2006
exactly, it is used only for encapsulation for hiding the information.
eg.. string class is also defined as final..if u want to see more than see the rt.jar in which all the classes are defined in jdk141_05jrelibrt.jar.
If you are sure on that behaiour of your class and sure that no one from outside world should not change the its behaviour, then you can make the class as final. Thats why java have String class as final why bcas java authors dont want to change its bahaviour.
Why would I want to make a class final? Doesn't that defeat the whole purpose of OO?
Profile Answers by krishna_darl Questions by krishna_darl
Questions by krishna_darl answers by krishna_darl