• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 9. Interfaces > Creating interfaces as data types

Creating interfaces as data types

Like a class, an interface defines a new data type. You can consider any class that implements an interface to be of the type that is defined by the interface. This is useful for determining whether a given object implements a given interface. For example, consider the interface IMovable, which you create in the following example.

To create an interface as a data type:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint