Originally posted by jaspreet atwal:
Thanks for your reply Ernest! I can live with that...
I was just wondering if there is some logic behind all this, something that will help me keep this in my mind instead of cramming/memorizing it.
Hmmm....
Jaspreet,
I have slightly different answer to this, [may be would help you to understand it and not cram],
Interface methods are already/implicitly abstract, i.e. there is no implementation available, and abstract and static can't go to-gather.
Lets assume its possible, now consider abstract static method declared in an interface "MyInterface", now this gives a great chance to the caller to call the method by doing "MyInterface.myStaticMethod()", right ? which ofcourse would lead no-where/doesn't make sense.
To block such usage, you will have to block "static" modifier to methods in interfaces.
BTW, this is the same case with abstract methods in an abstract class too. Once again, abstract and static can't go to-gather due to the reason above.