The point here is that there are no non-static inner,
local or anonymous interfaces (unlike classes).
See the example below.
When you define top-level nested class B, it is defined as static member of the enclosing top -level class A, but when you define an
interface, explicit static declaration is not needed and in that sense interfaces are implicitly static .
-Sandeep
Originally posted by April.Johnson:
From JLS 9.1.1.1: "Every interface is implicitly abstract."
From JLS 9.1.1: "The access modifier static pertains only to member interfaces."
So interfaces are implicitly abstract, not implicitly static.
Also you can have inner interfaces, referred to in JLS 9.1.1 as "member" or "nested" interfaces. (Also JLS 8.5 says: "A member interface is an interface whose declaration is directly enclosed in another class or interface declaration.")
Sandip is correct. From JLS 9.1.4: "All interface members are implicitly public."
As for why you'd use an inner interface, I haven't run across a situation that would warrant it, so I can't give you a real-world example.
April
------------------
www.tipsmart.com [This message has been edited by Sandeep Nachane (edited June 21, 2001).]