08 / 10

Describe interface type.

An Interface is an abstract type that includes a certain set of fields that a type must include to implement the interface.

  1. 1

    Interfaces are useful when you want to return an object or set of objects, but those might be of several different types.

  2. 2

    An interface specifies a set of fields that multiple object types can include

If an object type implements an interface, it must include all of that interface's fields: