This question may be silly but i accidentally checked in java source code that run method in runnable interface is defined with abstract keyword.
But according to interface definition all methods in an interface are by default abstract.
Then i am confused why specially Runnable interface has abstract keyword for run method.
I check with other interfaces like map , list etc but no one has abstract keyword.
Please give me an idea why it is written like this in java source code.
public abstract void run();
Thanks
From the java language specification:
Hey, just learned that my interface declarations are bad style, because I always use the
publicmodifier.apache Harmony just adds the public modifier (uuuh – bad style!).
SUNOracle has both modifiers? I guess that’s because in the ‘older versions’ it was mandatory to add theabstractmodifier – just because the JLS mentions ‘compatibilty with older versions’.And then: Never change a Runnable system 🙂