The methods in the interfaces will both be overridden by the method in the
Amphibious class.  If the interfaces where classes, Java would generate an
ambiguous method message.

    Steve Gawron

----- Original Message -----
From: "Jason Kilgrow" <[EMAIL PROTECTED]>
To: "JDJList" <[EMAIL PROTECTED]>
Sent: Friday, May 24, 2002 3:07 PM
Subject: [jdjlist] Same Method, Multiple Interfaces


> Group,
> Consider the following:
>
> public interface Car
> {
>     public void drive();
> }
>
> public interface Boat
> {
>     public void drive();
> }
>
> public class Amphibious
>     implements Car, Boat
> {
>     public void drive()
>     {
>         System.out.println("I'm driving my amphibious");
>     }
> }
>
>
> Which interface's method have I implemented? Does it matter?
>
>
> __________________________________________________________________
> Your favorite stores, helpful shopping tools and great gift ideas.
Experience the convenience of buying online with Shop@Netscape!
http://shopnow.netscape.com/
>
> Get your own FREE, personal Netscape Mail account today at
http://webmail.netscape.com/
>
>
> To change your membership options, refer to:
> http://www.sys-con.com/java/list.cfm


To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm

Reply via email to