/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
abstract class A {
public void coucou(){
System.
out.
println("Je suis A"); }
}
class B extends A {
@Override
public void coucou(){
System.
out.
println("Je suis B"); }
}
class C extends A {
@Override
public void coucou(){
System.
out.
println("Je suis C"); }
}
class UneClasse {
public void uneMethode(A a){
a.coucou();
}
}
class Ideone
{
{
UneClasse c = new UneClasse();
c.uneMethode(new A(){});
A a1 = new B();
c.uneMethode(a1);
A a2 = new C();
c.uneMethode(a2);
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgphYnN0cmFjdCBjbGFzcyBBIHsKICAgIHB1YmxpYyB2b2lkIGNvdWNvdSgpewogICAgCVN5c3RlbS5vdXQucHJpbnRsbigiSmUgc3VpcyBBIik7CiAgICB9CQp9CgpjbGFzcyBCIGV4dGVuZHMgQSB7CglAT3ZlcnJpZGUKICAgIHB1YmxpYyB2b2lkIGNvdWNvdSgpewogICAgCVN5c3RlbS5vdXQucHJpbnRsbigiSmUgc3VpcyBCIik7CiAgICB9CQp9CgpjbGFzcyBDIGV4dGVuZHMgQSB7CglAT3ZlcnJpZGUKICAgIHB1YmxpYyB2b2lkIGNvdWNvdSgpewogICAgCVN5c3RlbS5vdXQucHJpbnRsbigiSmUgc3VpcyBDIik7CiAgICB9CQp9CgpjbGFzcyBVbmVDbGFzc2UgewoJcHVibGljIHZvaWQgdW5lTWV0aG9kZShBIGEpewoJCWEuY291Y291KCk7Cgl9Cn0KCmNsYXNzIElkZW9uZQp7CglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbiAoU3RyaW5nW10gYXJncykgdGhyb3dzIGphdmEubGFuZy5FeGNlcHRpb24KCXsKCQlVbmVDbGFzc2UgYyA9IG5ldyBVbmVDbGFzc2UoKTsKCQljLnVuZU1ldGhvZGUobmV3IEEoKXt9KTsKCQlBIGExID0gbmV3IEIoKTsKCQljLnVuZU1ldGhvZGUoYTEpOwoJCUEgYTIgPSBuZXcgQygpOwoJCWMudW5lTWV0aG9kZShhMik7Cgl9Cn0=