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 CollectionT 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 ListT and a return type of T . The method returns the first element in the list or null if the list is empty.
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