Interface properties are declared using interface-property-declarations:
interface-property-declaration:
attributesopt newopt type identifier { interface-accessors }
interface-accessors:
attributesopt get ;
attributesopt set ;
attributesopt get ; attributesopt set ;
attributesopt set ; attributesopt get ;
The attributes, type, and identifier of an interface property declaration have the same meaning as those of a property declaration in a class (§10.7).
The accessors of an interface property declaration correspond to the accessors of a class property declaration (§10.7.2), except that the accessor body must always be a semicolon. Thus, the accessors simply indicate whether the property is read-write, read-only, or write-only.
The type of an interface property must be output-safe if there is a get accessor, and must be input-safe if there is a set accessor.
Do'stlaringiz bilan baham: |