  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | JSP - A mailing list about Java Server Pages specification and reference | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | Re: Interface question | Re: Interface question 2007-01-28 - By Dave Newton
Back --- Martin Gainty <mgainty@(protected)> wrote: > Without declaring with implements as in > ClassName implements InterfaceName > any static invocation in the class such as the > example illustrated below will be invalid..
Static invocation? There's no "static invocation" in the code you provided.
> >> package fu.bar; > >> class HttpSource { > >> RequestHandler reqHandler; > >> }; > >> > >> package fu.bar.*; > >> public class JDOMHttpSource extends HttpSource { > >> /******Constructor for JDOMHttpSource******/ > >> public JDOMHttpSource(RequestHandler req , int > method) { > >> }; > >> }; //class JDOMHttpSource > >> > >> could one instantiate a JDOMHttpSource class and > have any capability of referencing a valid > requestHandler (without implementing the interface > in referenced or base class)?
There's no interface here; what interface are you talking about?
Someone already pointed out that unless you call a super ctor that sets or explicitly set the RequestHandler member variable it obviously won't be valid.
The sample you provide does not declare an access modifier for reqHandler; IIRC the default is 'package-private' which means that a subclass in the same package would have access to the member variable.
Dave
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ______ __ __ 8:00? 8:25? 8:40? Find a flick in no time with the Yahoo! Search movie showtime shortcut. http://tools.search.yahoo.com/shortcuts/#news
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ To unsubscribe, e-mail: user-unsubscribe@(protected) For additional commands, e-mail: user-help@(protected)
|
|
 |