/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.lang.reflect.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
Method mfoo
= Derived.
class.
getMethod("foo"); boolean ovrFoo = mfoo.getDeclaringClass() != Base.class;
Method mbar
= Derived.
class.
getMethod("bar"); boolean ovrBar = mbar.getDeclaringClass() != Base.class;
System.
out.
println("Have override for foo: "+ovrFoo
); System.
out.
println("Have override for bar: "+ovrBar
); }
}
class Base {
public void foo() {}
public void bar() {}
}
class Derived extends Base {
@Override
public void bar() {}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmxhbmcucmVmbGVjdC4qOwppbXBvcnQgamF2YS5pby4qOwoKLyogTmFtZSBvZiB0aGUgY2xhc3MgaGFzIHRvIGJlICJNYWluIiBvbmx5IGlmIHRoZSBjbGFzcyBpcyBwdWJsaWMuICovCmNsYXNzIElkZW9uZQp7CglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbiAoU3RyaW5nW10gYXJncykgdGhyb3dzIGphdmEubGFuZy5FeGNlcHRpb24KCXsKCQlNZXRob2QgbWZvbyA9IERlcml2ZWQuY2xhc3MuZ2V0TWV0aG9kKCJmb28iKTsKCQlib29sZWFuIG92ckZvbyA9IG1mb28uZ2V0RGVjbGFyaW5nQ2xhc3MoKSAhPSBCYXNlLmNsYXNzOwoJCU1ldGhvZCBtYmFyID0gRGVyaXZlZC5jbGFzcy5nZXRNZXRob2QoImJhciIpOwoJCWJvb2xlYW4gb3ZyQmFyID0gbWJhci5nZXREZWNsYXJpbmdDbGFzcygpICE9IEJhc2UuY2xhc3M7CgkJU3lzdGVtLm91dC5wcmludGxuKCJIYXZlIG92ZXJyaWRlIGZvciBmb286ICIrb3ZyRm9vKTsKCQlTeXN0ZW0ub3V0LnByaW50bG4oIkhhdmUgb3ZlcnJpZGUgZm9yIGJhcjogIitvdnJCYXIpOwoJfQp9CgpjbGFzcyBCYXNlIHsKCXB1YmxpYyB2b2lkIGZvbygpIHt9CglwdWJsaWMgdm9pZCBiYXIoKSB7fQp9CmNsYXNzIERlcml2ZWQgZXh0ZW5kcyBCYXNlIHsKICAgIEBPdmVycmlkZQkKCXB1YmxpYyB2b2lkIGJhcigpIHt9Cn0=