aspose file tools*
The moose likes Beginning Java and the fly likes static interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "static interface " Watch "static interface " New topic
Author

static interface

meeta gaur
Ranch Hand

Joined: Dec 05, 2012
Posts: 305

public static interface WatchEvent.Kind<T>

http://docs.oracle.com/javase/7/docs/api/java/nio/file/WatchEvent.Kind.html

Interfaces are static ?


My one regret in life is that I am not someone else.
- Woody Allen
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

If it's nested, yes. Why would you think it couldn't be? You're aware nested classes can be static, right?
meeta gaur
Ranch Hand

Joined: Dec 05, 2012
Posts: 305

Jeff Verdegan wrote:If it's nested, yes. Why would you think it couldn't be? You're aware nested classes can be static, right?


I'm wondering because below post says ,

One cannot declare a top-level interface as static, but can do so within a class. You can have a static/non-static class in an interface.
[ June 18, 2008: Message edited by: Sidharth Pallai ]


http://www.coderanch.com/t/385650/java/java/static-interface

Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

meeta gaur wrote:

I'm wondering because below post says ,

One cannot declare a top-level interface as static, but can do so within a class. You can have a static/non-static class in an interface.
[ June 18, 2008: Message edited by: Sidharth Pallai ]


http://www.coderanch.com/t/385650/java/java/static-interface



I still don't see what you're confused about. The interface you're referring to is not top-level, but is nested within a class, just as that quote describes.
meeta gaur
Ranch Hand

Joined: Dec 05, 2012
Posts: 305

Thank you
Rajdeep Biswas
Ranch Hand

Joined: Mar 26, 2012
Posts: 186

Remember, only class level members can be declared static. I mean somehting like:
And so does the interface that you have mentioned.


The biggest gamble will be to ask a question whose answer you know in that it will challenge your theory | www.TechAspire.blogspot.in
 
Consider Paul's rocket mass heater.
 
subject: static interface