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

4.4. Summary

As you’ve seen, what’s generally referred to as polymorphism in the context of languages such as Java and C++ is a rather specific variety called subtype polymorphism. Further, the implementation in such languages is limited to single dispatch, which is again a specific case of the far more general possibility of multiple dispatch.

These languages subscribe to a view of OOP that demands methods (and data) belong to the enclosing class. It’s probable that this is the reason these languages support only single dispatch—they dispatch only on the receiver because it’s the class that owns the potentially polymorphic method.


  

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