Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


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

9. Other Framework Types > Interfaces & Classes

Interfaces & Classes

The syntax for defining an interface is almost identical to that for defining classes, but with two differences:

• An interface can contain only member definitions, not implementation. Essentially, an interface defines something a class (or other interface) can do, but leaves the doing of it up to the class itself.

• Interfaces cannot define fields, constructors, destructors or other types.

image

On Your Own

image

You may not realize it, but you already know how to create an interface in the Class Designer. Give it a try: Create the IPrintable interface and define its two methods.



  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


 Â