Re: Package level interfaces

From: Tony Morris (dibblego_at_optusnet.com.au)
Date: 07/05/04


Date: Mon, 5 Jul 2004 15:03:33 +1000


> > But isn't there a way to create an interface that can only be
implemented
> by
> > classes in the same package?
>
> No.

Well, yes, but I assume this isn't what you were asking.

// package scope interface
class interface X
{

}

I assume you were asking about the (non-)existance of package scope methods
of interfaces.
To want this indicates a design problem, rather than a language deficiency.

-- 
Tony Morris
(BInfTech, Cert 3 I.T.)
Software Engineer
(2003 VTR1000F)
Sun Certified Programmer for the Java 2 Platform (1.4)
Sun Certified Developer for the Java 2 Platform


Relevant Pages

  • Re: Separate Compilation in Programming Languages
    ... within one package body. ... all, separate or otherwise. ... OK, so you like having textually separate spec and body, ... Clients of an interface do not depend ...
    (comp.lang.ada)
  • Re: Global variables
    ... I have a litte OT question: how do you initialize the Repository? ... first class triggered the Starter class. ... principle of object orientation is to design towards an interface, ... Starter class must not reside in the interface respository package. ...
    (comp.object)
  • Re: Looking for Java metrics article and tool
    ... The article was about a method of analyzing the 'oo-ness'/coupling of a java ... tool itself scored a 100%:) If I recall correctly, ... The article explained the opinion of the author that a package in Java ... should either completely be an 'interface' (consisting of only interfaces ...
    (comp.object)
  • Re: static or not?
    ... > Thus, for example, controller.Driver will register its Controller ... then I can strip away an interface from this ... and have it register that interface in the Registry. ... if this is done from class foo, what's foo's package? ...
    (comp.lang.java.help)
  • Looking for Java metrics article and tool
    ... The article was about a method of analyzing the 'oo-ness'/coupling of a java ... The article explained the opinion of the author that a package in Java ... should either completely be an 'interface' (consisting of only interfaces ... solve this was a staged initialization procedure. ...
    (comp.object)