function of extends and implements keywords?

Answer Posted / jitender arora

Extending means adding new method definitions. Implementing
means satisfying the existing interface contract by writing
the proscribed method bodies.

When you derive a class from a base class we say the
derived subclass extends the base class. An interface can
also extend another interface. In contrast, when a class
provides the methods (possibly abstract) necessary to
conform to some interface we say that class implements the
interface. Extending a class is closely related to
implementing an interface. A new class can extend at most
one superclass, but it may implement several interfaces.
In interface may extend several other interfaces (though a
class implements an interface). You sometimes do this to
give you a short same to stand for the requirement
implementing half a dozen related interfaces.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can constructors be synchronized in java?

608


What is a class loader?

578


Is the infobus client side only?

598


Explain what is synchronization?

566


What is the form of storage space in java?

1729






What does module-relative mean?

568


Are enterprise beans allowed to use thread.sleep()?

639


Why a component architecture for the java platform?

566


Why do I get a duplicate name error when loading a jar file?

538


Name three component subclasses that support painting?

606


What is the immediate superclass of the applet class?

590


What is the difference between the string and stringbuffer classes?

532


Is the session factory thread safe?

661


what is Activation Instantinator?

1901


What is local interface. How values will be passed?

541