You are on page 1of 2

interface:

----------
*interface is a contract to set of classes,which will provide set of rules|
standards
to be implemented by classes

interface inventory class product{


| add(){...}
add() .. }
remove() --------------->class category{
.. add(){..}
.. }
|
rules|standards |
[defined by rules implemented by classes
framework(or) [ developers ]
team lead]

*interface is a collection of variables and methods without


functionality

variable without initialization


-----> without functionality
method without functionality[code]

*interface will have prototype of methods


*syntax:
interface <interfacename>
{
<varname>:<type>;
...
<methodname>(paar1,..):<type>;
...
}

*interface doesn't allow access specifier,default is public


*A class implementing interface should provide functionality to
all the method of an interface
*A class can extend only one class but can implement more than
one interface
*syntax:

You might also like