DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2006

    Extends and implements

    I've just learned Java and i have a problem. That is extends and imlements.
    Can you tell me when use extends and imlements in heritage class.
    And tell me the different of them.
    Thank you !

  2. #2
    Join Date
    Dec 2004
    San Bernardino County, California
    You implement an interface. An interface is the "signature" (declaration) of fields or methods which will be defined in those classes which implement the interface. It allows a calling class to address all objects which implement the interface in a common way, while each implementation can carry out the work differently.

    You extend a parent class (inheritance). You inherit the parent class's fields and methods, which you can supplement or override.

  3. #3
    Join Date
    Nov 2006
    actually interfaces (those are implemented) exist because java doesn't support the multiple inheritance - you can think of a lot of reasons when it comes methods which have the same signature. Interfaces offer a lot other advantages. a class can implement many interfaces. because the methods are never implemented - only their signature exists... read more about it on the net... wikipedia should give you an overview about the basic principles of java.

Similar Threads

  1. Error: an enclosing instance that contains...
    By phatslug311 in forum Java
    Replies: 7
    Last Post: 02-11-2009, 03:02 PM
  2. abstract class
    By just a beginner in forum Java
    Replies: 2
    Last Post: 10-08-2001, 08:13 AM
  3. extends vs. implements
    By Mike in forum Java
    Replies: 3
    Last Post: 06-14-2000, 07:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.