日期:2014-05-20 浏览次数:20705 次
package test0;
public interface ITest2 {
void showMessage();
}
package test0;
public class Test2 implements ITest2 {
private static final ITest2 instance = new Test2Impl1();
@Override
public void showMessage() {
instance.showMessage();
}
}
package test0;
class Test2Impl1 implements ITest2{
@Override
public void showMessage() {
System.out.println("hello world.");
}
}