首页  

jdk里的泛型     所属分类 java 浏览量 1247
jdk里经典的泛型用法 

java.util.Arrays
java.util.Collections 
java.util.HashMap



java.util.HashMap


public class HashMap<K,V> extends AbstractMap<K,V>
    implements Map<K,V>, Cloneable, Serializable
    
static class Node<K,V> implements Map.Entry<K,V> {
        final int hash;
        final K key;
        V value;
        Node<K,V> next;
        
public V put(K key, V value)

public void putAll(Map<? extends K, ? extends V> m)
 
public V get(Object key) 
 
public Set<K> keySet()

public Collection<V> values()

public Set<Map.Entry<K,V>> entrySet()






java.util.Arrays public static <T> List<T> asList(T... a) { return new ArrayList<>(a); } public static <T> int binarySearch(T[] a, T key, Comparator<? super T> c) { return binarySearch0(a, 0, a.length, key, c); } public static <T> T[] copyOfRange(T[] original, int from, int to) public static <T> void sort(T[] a, Comparator<? super T> c) public static <T> Stream<T> stream(T[] array) public static <T,U> T[] copyOf(U[] original, int newLength, Class<? extends T[]> newType) { @SuppressWarnings("unchecked") T[] copy = ((Object)newType == (Object)Object[].class) ? (T[]) new Object[newLength] : (T[]) Array.newInstance(newType.getComponentType(), newLength); System.arraycopy(original, 0, copy, 0, Math.min(original.length, newLength)); return copy; } public static <T> void parallelSort(T[] a, Comparator<? super T> cmp)
java.util.Collections public static final <T> List<T> emptyList() { return (List<T>) EMPTY_LIST; } public static <T extends Object & Comparable<? super T>> T max(Collection<? extends T> coll) public static <T> void sort(List<T> list, Comparator<? super T> c) public static <T> int binarySearch(List<? extends Comparable<? super T>> list, T key) public static <T> int binarySearch(List<? extends T> list, T key, Comparator<? super T> c) public static void reverse(List<?> list) public static <T> List<T> singletonList(T o) { return new SingletonList<>(o); } public static <T> List<T> synchronizedList(List<T> list) public static <T> List<T> unmodifiableList(List<? extends T> list)
java泛型 java泛型技巧

上一篇     下一篇
fastjson为什么这么多安全漏洞

递归与尾递归java实例

物联网云平台简介

springboot2单元测试

项目管理八大原则

springboot文件上传异常分析及解决方案