When i try some code, i found strange (for me) behaviour:
compiler error wrote: error: ment(List<String>) in B cannot override ment(List<String>) in A public List<Integer> ment(List<String> a){ return type List<Integer> is not compatible with List<String>
thats looks not strange, next i edit class B ment parameter to
List a
unchecked warning wrote:uses unchecked or unsafe operations.
but code compile ok - and i think this is strange but my first opinion than if i also change class A ment parament to
List a code will compile to, but i was wrong
compiler error wrote:ment(List) in B cannot override ment(List) in A public List<Integer> ment(List a){ return type List<Integer> is not compatible with List<String>
_____________________
My question is why second example compile ok and why third not compile?