Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Interface question

Reply
Thread Tools

Interface question

 
 
Sparko
Guest
Posts: n/a
 
      03-02-2004
If one defines an interface with no method declarations, just public
static final constants, can one then refer to the constants in the
implementing class or are the constants defined in the interface only
available in an implemented method.
 
Reply With Quote
 
 
 
 
Johann Weber
Guest
Posts: n/a
 
      03-02-2004

Sparko wrote:
> If one defines an interface with no method declarations, just public
> static final constants, can one then refer to the constants in the
> implementing class or are the constants defined in the interface only
> available in an implemented method.


Writing this question (I'm not shure I understand it fully) takes more
time than writing the code to try it out.

Just try it out!
 
Reply With Quote
 
 
 
 
xarax
Guest
Posts: n/a
 
      03-02-2004
"Sparko" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> If one defines an interface with no method declarations, just public
> static final constants, can one then refer to the constants in the
> implementing class or are the constants defined in the interface only
> available in an implemented method.


A class that implements an interface will inherit
all of the declarations and fields of that interface.


 
Reply With Quote
 
Tor Iver Wilhelmsen
Guest
Posts: n/a
 
      03-02-2004
"xarax" <(E-Mail Removed)> writes:

> A class that implements an interface will inherit
> all of the declarations and fields of that interface.


Sometimes called the "pre-1.5-static-import-hack".
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Going from higher security level interface to lower security interface- HELP!!! - AM Cisco 4 12-28-2004 09:52 PM
PCI interface or USB interface David Wireless Networking 4 09-16-2004 01:01 PM
allow ssh only on outside interface, but telnet on inside interface of router no-one Cisco 0 07-28-2004 04:17 PM
PIX: how to allow 1 host from outside interface to access another host on the inside interface? jonnah Cisco 1 04-21-2004 02:26 PM
static nat between phisical interface and virtual interface on same ethernet Andrea Cisco 0 04-19-2004 09:37 AM



Advertisments