hi guys, Can any one tell me what's the use of an private and protected interface
posted 16 years ago
Top level (package level) interfaces are public by default. This is trye even if you don't explicitly define any modifier. You can't define private/protected interfaces at package level. However, interfaces defined inside a class can have any accessibility including protected and private. Let us see where these can be used. Supposing A be top level class and IFace be inner interface defined with private modifier. Then all inner classes defined inside class A can inherit IFace. Subclasses of A cannot define inner classes that implement IFace. With protected modifier subclasses of A can define inner classes which can implement IFace. -Ramesh
Oh the stink of it! Smell my tiny ad!
the new thread boost feature: great for the advertiser and smooth for the coderanch user