Extends and implements


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Extends and implements

  1. #1
    Join Date
    Sep 2006
    Posts
    6

    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
    Location
    San Bernardino County, California
    Posts
    1,468
    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
    Posts
    35
    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
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

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