Pergunta de entrevista da empresa Bloomberg

Is this possible in Java?: Public void doSomething(List<String> bar){...} Public void doSomething(List<Integer> bar){...}

Respostas da entrevista

Sigiloso

19 de jun. de 2016

Type erasure feature changes both functions to (List bar) and the compiler sees it as a single method declared twice. Thats why it is not allowed.

Sigiloso

7 de mai. de 2015

No. Check generics and overriding function in java