InterviewSolution
| 1. |
What Are The Methods Added To Collections In Java 9? |
|
Answer» With java 9, following methods are added to List, Set and MAP interfaces along with their overloaded counterparts. static <E> List<E> of(E e1, E e2, E e3); static <E> Set<E> of(E e1, E e2, E e3); static <K,V> Map<K,V> of(K k1, V V1, K K2, V v2, K k3, V v3); static <K,V> Map<K,V> ofEntries(Map.Entry<? extends K,? extends V>... entries) note:
With java 9, following methods are added to List, Set and Map interfaces along with their overloaded counterparts. static <E> List<E> of(E e1, E e2, E e3); static <E> Set<E> of(E e1, E e2, E e3); static <K,V> Map<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3); static <K,V> Map<K,V> ofEntries(Map.Entry<? extends K,? extends V>... entries) note: |
|