What does this program print?

from Object-oriented programming
Java 25 LTS beginner 2 min

What does this program print?

Java
public class Main {
    static class Base {
        String label() { return "base"; }
    }

    static final class Child extends Base {
        @Override
        String label() { return "child"; }
    }

    public static void main(String[] args) {
        Base value = new Child();
        System.out.println(value.label());
    }
}
Open in playground
Report an error