Why I cannot override method wait() in Java? -
i find method wait()
in class object
.
final means method cannot overriden.
ideas why it's final?
@flavio - it's question.
the reason you can't override it, of course, designers made "final".
a couple of potential reasons decision:
you don't want people mess semantics of fundamental operation on fundamental class (class "object").
since it's "final", compilers can optimize performance (save few cycles) in-lining "wait()"
"final" increases security of java object model preventing malicious code exploiting "wait()".
Comments
Post a Comment