aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes nested interface. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "nested interface." Watch "nested interface." New topic
Author

nested interface.

Shivani Chandna
Ranch Hand

Joined: Sep 18, 2004
Posts: 380
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?


/** Code speaks louder than words */
anand phulwani
Ranch Hand

Joined: Sep 10, 2005
Posts: 242
A Humble Request
Shivani it would be too good if you just elaborate your question a bit.

Thanks
Anand


Thanks and Regards, Anand
SCJP 5.0 310-055 73%, SCWCD 1.4 310-081 78%, IBM DB2 9 Fundamentals 000-730 62%
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

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?


"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
Sandeep Chhabra
Ranch Hand

Joined: Aug 28, 2005
Posts: 340
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 ]

Regards<br />Sandy<br />[SCJP 5.0 - 75%]<br />[SCWCD 1.4 - 85%]<br />------------------<br />Tiger, Tiger burning bright,<br />Like a geek who works all night,<br />What new-fangled bit or byte,<br />Could ease the hacker's weary plight?
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

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)

 
wood burning stoves
 
subject: nested interface.