aspose file tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Question about Interface Declaration Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "Question about Interface Declaration" Watch "Question about Interface Declaration" New topic
Author

Question about Interface Declaration

Mohit Goyal
Ranch Hand

Joined: Nov 09, 2003
Posts: 65
Hi
Well cud anybody tell me about which modifiers( access and non-access )
can be used when declaring an interface and what r the implicit modifiers .
Jessica Sant
Sheriff

Joined: Oct 17, 2001
Posts: 4313

This section of the JLS lists all the possible interace modifiers:
�9.1.1 Interface Modifiers
InterfaceModifier: one of
public protected private
abstract static strictfp
The access modifier public is discussed in �6.6. Not all modifiers are applicable to all kinds of interface declarations. The access modifiers protected and private pertain only to member interfaces within a directly enclosing class declaration (�8.5) and are discussed in �8.5.1. The access modifier static pertains only to member interfaces (�8.5, �9.5). A compile-time error occurs if the same modifier appears more than once in an interface declaration.


- Jess
Blog:KnitClimbJava | Twitter: jsant | Ravelry: wingedsheep
Mohit Goyal
Ranch Hand

Joined: Nov 09, 2003
Posts: 65
well interfaces are implicitly abstract so how can we use strictfp in the interface declaration . won't that give a compiler error
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8876

Originally posted by Mohit Goyal:
well interfaces are implicitly abstract so how can we use strictfp in the interface declaration . won't that give a compiler error

No it doesn't.strictfp in interface implies that all nested types declared in the interface are implicitly strictfp.


Groovy
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Question about Interface Declaration
 
Similar Threads
Kathy Book - Declarations and Access Control Doubt
A confirmation required about interfaces...
remembering access modifiers
interface
Abstract class and interface.