naveen yadav wrote:Hi ranchers ,
if synchronized is added explicitly to run() , then shouldn't it give error.
Because we are changing the nature of run() , which originally designed to be executed by more than one thread at a time . but once it is declared
synchronized only one thread can execute it at a time.
Any thoughts ?
(I am quoting this post because it was originally completely different. Stephan's answers refer to the original version of the post, which no longer exists.)
You'll find that the code you posted does indeed compile.
There are rules for how you can inherit methods from superclasses and interfaces. What you said there isn't those rules.