Lecture overview -- Keyboard shortcut: 'u'  Previous page: Interfaces -- Keyboard shortcut: 'p'  Next page: Examples of Interfaces -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Help page about these notes  Alphabetic index  Course home  Page 12 : 37
Object-oriented Programming in C#
Abstract classes, Interfaces, and Patterns
Interfaces in C#

Both classes, structs and interfaces can implement one or more interfaces

Interfaces can contain signatures of methods, properties, indexers, and events


modifiers interface interface-name : base-interfaces {
  method-descriptions
  property-descriptions
  indexer-descriptions
  event-descriptions
}

return-type method-name(formal-parameter-list);

return-type property-name{
  get;
  set;
}

return-type this[formal-parameter-list]{
  get;
  set;
}

event delegate-type event-name;

The syntax of a C# interface, together with the syntaxes of method, property, indexer, and event descriptions in an interface