This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
It is true that the return type of the method getMyClass() is MyInterface, and MyClass implements MyInterface.
However, the method sayHelloFromMyClass() is not a member of MyInterface, so unless you cast myInterfaceReference to a MyClass reference, or add the method header of sayHelloFromMyClass() to MyInterface, you can't call sayHelloFromMyClass() with myInterfaceReference. [ July 19, 2006: Message edited by: Keith Lynn ]