File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

member declaration with in a interface

 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Every member type declaration(classes as well as interfaces)
appearing within the body of a directly enclosing interface is
implicitly static and public.

Any logical reason why they are implicitly static?
 
Tony Morris
Ranch Hand
Posts: 1608
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Conversely, any logical reason why they wouldn't be?
Think about it some more
 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cannot refer to "this" inside a interface. Hence there is no point in
going for a non-static member interface. But why the same for member class
inside an interface.
 
Rick O'Shay
Ranch Hand
Posts: 531
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To create the innner class you would need an instance of the containing class but there is no such thing: it's an interface. Ignoring that, what benefit would you derive with an inner class instance? Access to package and private scope fields and methods? There are none.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic