package study.itest;
public interface IOne {
public String getString();
}
----------------------------------
package study.itest;
public class Two implements IOne {
@Override
public String getString() {
return this.getClass().getName();
}
}
----------------------------------
package study.itest;
public class Three implements IOne {
@Override
public String getString() {
return this.getClass().getName();
}
}
----------------------------------
package study.itest;
public class Output {
public static void Show(IOne one) {
System.out.println("Show:" + one.getString());
}
public static void main(String[] args) {
IOne one = null;
one = new Two();
Show(one);
one = new Three();
Show(one);
}
}