// The pointy behavior as a read-only property.
public interface IPointy
{
// A read-write property in an interface would look like
// retVal PropName { get; set; }
// while a write-only property in an interface would be
// retVal PropName { set; }
byte Points{ get; }
}
■
Note
Interface types can also contain event (see Chapter 11) and indexer (see Chapter 12) definitions.
Do understand that interface types are quite useless on their own, as they are nothing more
than a named collection of abstract members. For example, you cannot allocate interface types as
you would a class or structure:
Do'stlaringiz bilan baham: |