Java Casting Interface à la classe

public class InterfaceCasting {

    private static class A{}

    public static void main(String[] args) {
        A a = new A();
        Serializable serializable = new Serializable(){};
        a = (A)serializable;
    }

}

Compilation réussir, mais en Runtime exception

Exception in thread "main" java.lang.ClassCastException: InterfaceCasting$1 cannot be cast to InterfaceCasting$A

POURQUOI COMPILATION RÉUSSIR? Compilateur doit connu que serialiazable n'est pas Un?

source d'informationauteur komenan