The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
February 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

interfaces

Posted by Jody Brown on February 20, 2001 at 8:22 AM

By implementing an interface, you are forming a 'contract' between the class programmer and the user of that class that states "this class is guaranteed to provide the minimum functionality dictated by this defined interface." A very simple example is a FileLoader interface that defines a loadFile() method signature. Say you want to write two classes, MacintoshFileLoader and PCFileLoader. By having these classes implement the FileLoader interface, anyone using the two classes would be sure that an implementation of the loadFile() method would be provided.

Hope this helps.

Regards,

Jody



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us