Home Help Java I The implement keyword
Questions:Ask|Latest


 
 

Share on Google+Share on Google+

The implement keyword

Advertisement
In java programming language, the keyword implement specifies that the given class implements an interface.

The implement keyword

     

In java programming language, the keyword implement specifies that the given class implements an interface. Keywords are basically reserved words which have specific meaning relevant to a compiler.

Syntax: Here is the syntax for using the implement keyword in a class.

public class DominoPizza implements Pizza

{

/ write your code here

}

Note: Here are the some point that must be considered while implementing an interface (or interfaces) into a java class.

  • A class implementing an interface must either implement all the methods of that interface otherwise known as the abstract class.
  • A class in java may extend at most one superclass because java does not allow multiple inheritance, by it may implement more than one interface.
  • Multiple inheritance in java is achieved through the interfaces.
  • When a class implements more than one interface then implement statement requires a comma-separated list of interfaces to be implement by that class.
Advertisements

Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: November 11, 2009

Ask Questions?    Discuss: The implement keyword  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
sumit
March 25, 2012
java

i am not understand what the mean of implement interface
DMCA.com