Specifications

Sun Services
Java™ Programming Language
Module 7, slide 34 of 44
Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. Sun Services, Revision F
Interfaces
•Apublic interface is a contract between client code and
the class that implements that interface.
A Java interface is a formal declaration of such a contract
in which all methods contain no implementation.
Many unrelated classes can implement the same
interface.
A class can implement many unrelated interfaces.
Syntax of a Java class is as follows:
<modifier>
class
<name> [
extends
<superclass>]
[
implements
<interface> [,<interface>]* ]
{
<member_declaration>*
}