/* package whatever; // don't place package name! */
import java.util.* ;
import java.lang.* ;
import java.io.* ;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
public interface People {
void talk( ) ;
}
public static class Human implements People {
public void talk( ) {
}
}
public static class Robot { public void talk( ) {
}
}
public static void startTalk( Human human) {
human.talk ( ) ;
}
{
Human human = new Human( ) ;
startTalk( human) ;
startTalk( robot) ; // 에러 발생(error: incompatible types)
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBpbnRlcmZhY2UgUGVvcGxlIHsKCSAgICBTdHJpbmcgd2hvQW1JID0gIlBlb3BsZSI7CgkgICAgdm9pZCB0YWxrKCk7Cgl9CgkKCXB1YmxpYyBzdGF0aWMgY2xhc3MgSHVtYW4gaW1wbGVtZW50cyBQZW9wbGUgewoJCVN0cmluZyB3aG9BbUkgPSAiSHVtYW4iOwoJCXB1YmxpYyB2b2lkIHRhbGsoKSB7CgkJICAgIFN5c3RlbS5vdXQucHJpbnRsbih3aG9BbUkpOwoJCX0KICAgIH0JCiAgICAKICAgIHB1YmxpYyBzdGF0aWMgY2xhc3MgUm9ib3QgewogICAgCVN0cmluZyB3aG9BbUkgPSAicm9ib3QiOwogICAgCXB1YmxpYyB2b2lkIHRhbGsoKSB7CiAgICAJCVN5c3RlbS5vdXQucHJpbnRsbih3aG9BbUkpOwogICAgCX0KICAgIH0KICAgIAogICAgcHVibGljIHN0YXRpYyB2b2lkIHN0YXJ0VGFsayhIdW1hbiBodW1hbil7CiAgICAJaHVtYW4udGFsaygpOwogICAgfQoKCX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