class Base {
Base() {
System.
out.
println("Construção Base"); metodo();
}
void metodo() {
System.
out.
println("Método em Base"); }
}
class Derivada extends Base {
Derivada() {
System.
out.
println("Construção Derivada"); }
@Override
void metodo() {
System.
out.
println("Método em Derivada"); }
}
class Ideone {
public static void main
(String args
[]) { Base base = new Base();
base.metodo();
System.
out.
println("------------------------"); Derivada derivada = new Derivada();
derivada.metodo();
}
}
Y2xhc3MgQmFzZSB7CiAgICBCYXNlKCkgewogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiQ29uc3RydcOnw6NvIEJhc2UiKTsKICAgICAgICBtZXRvZG8oKTsKICAgIH0KICAgIHZvaWQgbWV0b2RvKCkgewogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiTcOpdG9kbyBlbSBCYXNlIik7CiAgICB9Cn0KCmNsYXNzIERlcml2YWRhIGV4dGVuZHMgQmFzZSB7CiAgICBEZXJpdmFkYSgpIHsKICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oIkNvbnN0cnXDp8OjbyBEZXJpdmFkYSIpOwogICAgfQogICAgQE92ZXJyaWRlCiAgICB2b2lkIG1ldG9kbygpIHsKICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oIk3DqXRvZG8gZW0gRGVyaXZhZGEiKTsKICAgIH0KfQoKY2xhc3MgSWRlb25lIHsKICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0cmluZyBhcmdzW10pIHsKICAgICAgICBCYXNlIGJhc2UgPSBuZXcgQmFzZSgpOwogICAgICAgIGJhc2UubWV0b2RvKCk7CiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCItLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0iKTsKICAgICAgICBEZXJpdmFkYSBkZXJpdmFkYSA9IG5ldyBEZXJpdmFkYSgpOwogICAgICAgIGRlcml2YWRhLm1ldG9kbygpOwogICAgfQp9