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

Chapter 9. Interfaces > Interface Syntax and Use

9.3. Interface Syntax and Use

Recall that an interface defines a new datatype without implementing any of the methods of that datatype. Thus, to create an interface, we use the following syntax:

interface SomeName {
  function method1 (param1:datatype,...paramn:datatype):returnType;
  function method2 (param1:datatype,...paramn:datatype):returnType;
  ...
  function methodn (param1:datatype,...paramn:datatype):returnType;
}


  

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