Exam (elaborations) java Collections, Maps and Iterators
1. Give the definition of a boolean valued static generic method named inSome . The method inSome has two parameters of type Collection<T> and one parameter of type T . The method returns true if the parameter of type T is in either (or both) collections; it returns false otherwise. 2. Give the definition of a static generic method named getFirst that has one parameter of type List<T> and a return type of T . The method returns the first element in the list or null if the list is empty.
Libro relacionado
- 2012
- 9780132989961
- Desconocido
Escuela, estudio y materia
- Institución
- Harvard University
- Grado
- Java Collections, Maps and Iterators
Información del documento
- Subido en
- 7 de febrero de 2023
- Número de páginas
- 4
- Escrito en
- 2022/2023
- Tipo
- Examen
- Contiene
- Preguntas y respuestas
Temas
-
java collections
-
maps and iterators
-
java
Documento también disponible en un lote