Generics and the ArrayList Class in java
Generics and the ArrayList Class in java 1. Suppose list is an object of the class ArrayListString . How do you add the string "Hello" to the ArrayList list ? 2. Suppose instruction is an object of the class ArrayListString that contains the string "Stop" at index position 5 . How do you change the string at index position 5 to "Go" (without changing any of the elements at other positions)? 3. Suppose instruction is an object of the class ArrayListString that contains strings at index positions 0 through 10 . How do you insert the string "Go" at index position 5 so that no strings are removed from the list instruction?
Información del documento
- Subido en
- 7 de febrero de 2023
- Número de páginas
- 9
- Escrito en
- 2022/2023
- Tipo
- Examen
- Contiene
- Preguntas y respuestas