The Artima Developer Community
Sponsored Link

Legacy Design Forum
Designing with Interfaces



This page contains an archived post to the Design Forum (formerly called the Flexible Java Forum) made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


Re: Two interfaces with a common method?.

Posted by BK Lau on April 26, 2000 at 5:42 PM

I have a question:

If you have 2 interfaces below:

public interface A
public void sayHello();
public void sayWorld();

public interface B
public void sayHello();
public void sayYahoo();

Let a class C implement interfaces A , B:

public class C implements A,B
public void sayHello(){ System.out.println("Hello"); //interface does this implementation belongs to ???
//Will it even compile???

public void sayWorld(){ System.out.println("World");
public void sayYahoo(){ System.out.println("Yahoo");


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us