Java question

Feb 11, 2008 04:54



interface IBar { }

interface IBaz {
public IBar foo(); // returns something of type implementing IBar
}

interface IBarPrime extends IBar {}

interface IBazPrime extends IBaz {
public IBarPrime foo(); // does this specify that an IBasPrime's implementation
// of IBaz.foo() has to return something of type IBarPrime?
}

class BazImpl implements IBazPrime {
public IBarPrime foo() { } // does this satisfy "foo" from both interfaces?
}
Previous post Next post
Up