This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Interface Implementation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Interface Implementation" Watch "Interface Implementation" New topic
Author

Interface Implementation

phanikumar denduluri
Greenhorn

Joined: Sep 04, 2003
Posts: 1
Can an interfaec be implemented outside a package. This is because we cannot specify access modifier to an interface. please answer my question
M Sharma
Ranch Hand

Joined: Dec 13, 2001
Posts: 106
Hi phanikumar,
I think we can specify an access modifier for an interface.
Only public and default access modifier are allowed for an interface.
If you wish to access the interface outside the package declare it as public interface and if you do not wish to access interface outside the package then do not specify any modifier (default) while declaring it. default access modifier will only make it available to the current package.


Regards, Manish
SCJP 1.4
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1871
I agree with Manish.
Regards
Maulin
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Interface Implementation
 
Similar Threads
How To Call Two Different Classes From the Main Program Using the Same API?
Home interface or Home Interface stub
Time Capsule
Writing an Interface
Regarding Interfaces