I downloaded JWhiz trial, and mentioned in its tips is that "Interface methods can't be native, static, synchronized, final, private, protected or abstract. " Interface methods I presume are implicitly abstract. This contradicts above statement. And I think interface methods can also be static. Is it right? Thanks, zeeshan.
interaces are just models over how the class looks, so there arn't really any methods. There for they can't be abstract. They work similar to abstract methods, given that you have to implement them, but they are not abstract methods. As far as static is concerned, you need code for it to work, hence they can't be static. /Mike
Actually, I think Zeeshan is correct in his first assertion--interface methods are considered to be (implicitly) abstract. It is even possible (although discouraged) to use the "abstract" modifier with them. See JLS 9.4 for details. However, interface methods can't be static _because_ they are abstract (static methods can't be overriden). Member types (classes and interfaces) within interfaces are considered to be implicitly static and public though--they would have to, as interfaces can't be instantiated. Ranjan