Re: understand the concept of interfaces
- From: Thomas Schodt <spamtrap0607@xxxxxxxxxxxxxxxxx>
- Date: Tue, 28 Nov 2006 14:32:38 +0000
Prejith wrote:
i am new to java and i am in the learning phase of core java .i know that
Java doesnt support Multiple Inheritance instead the work around is to use
Interface
It is not a workaround,
the way Java implements inheritance / interfaces
has the side effect of
eliminating the classic multiple-inheritance issue.
but the doubt i have is interface are nothing but empty abstract
methods.when ever i implement those methods in a class i have to write the
method body in the class.. .if interface is just emply methods then what is
the point of having those empty method names under one tag..
An interface is a promise to implement a method with a specific name and a specific signature.
The beauty when it comes to the classic multiple-inheritance issue is;
two different interfaces used for different purposes
could potentially have a name/signature conflict,
in which case sorting out the mess
is left as an exercise for the person implementing the class.
As Java only allows you to extend one class
there can never be two conflicting implementations.
.
- References:
- understand the concept of interfaces
- From: Prejith
- understand the concept of interfaces
- Prev by Date: Re: Save gif file from the URL
- Next by Date: Re: Save gif file from the URL
- Previous by thread: Re: understand the concept of interfaces
- Next by thread: Re: understand the concept of interfaces
- Index(es):
Relevant Pages
|
|