Can we define Interface as protected/private instead of public? What happened in that situations? Please provide complete details..
Printable View
Can we define Interface as protected/private instead of public? What happened in that situations? Please provide complete details..
<<public/default>> interface interfacename{static variables; abstract methods}
difference between finance & accounts
Interface defaulty it is public.
The sun specification for interfaces is it must be accessible from any class and from any package.
If we are declaring that as protected or private we are not giving ability to access from all other packages.
If interface is define as protected or private, that means we can't access that interface from all other packages, but interface specification is said by sun "interface must be accessible from any class and any package".