This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Java in General and the fly likes static interfaces Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "static interfaces" Watch "static interfaces" New topic
Author

static interfaces

Mathew Kuruvilla
Ranch Hand

Joined: Nov 27, 2001
Posts: 136
Are interfaces automatically static?
Vijayendra V Rao
Ranch Hand

Joined: Jul 04, 2004
Posts: 195
Originally posted by Mathew Kuruvilla:
Are interfaces automatically static?


Where did you read this?!


Vijayendra <br /> <br />"The harder you train in peace, the lesser you bleed in war"
Preetham Chandrasekhar
Ranch Hand

Joined: Nov 05, 2003
Posts: 98
i know interfaces by default are abtract and public. I know we do have static interfaces too...but im not sure if they are static by default. Another thing what Im sure about is you cant declare static methods in an interface.

hmmm...finally I didnt answer your question huh.... :-)

Preetham


"In theory, there is no difference between theory and practice. But, in practice, there is."<br /> - Jan L.A. van de Snepscheut
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Section 8.1.2 of the Java Language Specification states, "Member interfaces ... are always implicitly static..."

Ref: http://java.sun.com/docs/books/jls/second_edition/html/jTOC.doc.html

Because they're implicitly static, nested interfaces can be implemented without an instance of the enclosing class. (Top-level interfaces are another matter. I don't see that "static" would have any meaning in that context.)
[ December 02, 2004: Message edited by: marc weber ]

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: static interfaces
 
It's not a secret anymore!