O trecho de código Java (executado em condições ideais, com as bibliotecas adequadas importadas) que não apresenta erros nem exceções é
- A)int[] numeros = new int[3]; numeros[3] = 10;
- B)String texto = null; System.out.println(texto.toUpperCase());
- C)for (int i = 0; i < 10; i++) int x = i * 2; System.out.println(x);
- D)Map<String, Integer> mapa = new HashMap<>(); mapa.put("chave", 42); System.out.println(mapa.getOrDefault("outraChave", 0) + mapa.get("chave"));
- E)List<Integer> lista = new ArrayList<>(); lista.add("texto");