If compiled, it will not be type safe:
B b = new B(); ba = new A(); SubclassOfA foo = b.<SubclassOfA>getA();
The compiler cannot guarantee that a will be an instance of T , and it will not even be able to check it at runtime due to type erasure - therefore, it will not compile.
Generally, Java Generics FAQs cover almost everything.
source share