Galera, estou fazendo alguns simulados e travei na seguinte questão:
What will be the result of attempting to compile the following code?
public class RQ100_70 { public static void main(String[] args) { List<Integer> glst1 = new ArrayList(); //(1) List nglst1 = glst1; //(2) List nglst2 = nglst1; //(3) List<Integer> glst2 = glst1; //(4) } }
Select the one correct answer.
(a) The code will compile without any warnings.
(b) The code will compile with an unchecked warning in (1).
© The code will compile with an unchecked warning in (2).
(d) The code will compile with an unchecked warning in (3).
(e) The code will compile with an unchecked warning in (4).
A resposta no livro, diz que a resposta correta é a alternativa B. Só que quando eu copio e colo o código no eclipse ele gera “warnings” em todas as linhas?
Ja tentei mexer nas configurações do eclipse, mas não consegui fazer uma configuração que exibesse warning somente na linha (1).
Vocês tem alguma idéia para me ajuda?
Abraços,