Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

nested interface.

 
Shivani Chandna
Ranch Hand
Posts: 380
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok interface that is non nested cannot be static.
What is the purpose of java -- Allowing a static private nested interface to be existing in a class?
 
anand phulwani
Ranch Hand
Posts: 242
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A Humble Request
Shivani it would be too good if you just elaborate your question a bit.

Thanks
Anand
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Shivani Chandna:
... What is the purpose of java -- Allowing a static private nested interface to be existing in a class? ...

To allow for implementation by a private static nested class?
 
Sandeep Chhabra
Ranch Hand
Posts: 340
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

and what about this marc:


This too compiles and runs.
I think nested interfaces are implictly static, and explicitly marking them static doesnt makes any sense.

Also interfaces are implictly abstract.

I may be wrong. If so do correct me

Thanx
Sandy
[ September 15, 2005: Message edited by: Sandeep Chhabra ]
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sandeep Chhabra:
...I think nested interfaces are implictly static, and explicitly marking them static doesnt makes any sense.

Also interfaces are implictly abstract.

You are correct.

"Member interfaces ... are always implicitly static..." (Ref: JLS 8.1.2)

"Every interface is implicitly abstract. This modifier is obsolete and should not be used in new programs." (Ref: JLS 9.1.1.1)

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic