Coding Standards essays

1, Set, and Map Key with custom objects, objects need to override toString and hasCode.

2, ArrayList of subList not return list, will subList action ConcurrentModificationException exception.

3, array to a list, the list is also an array structure, the converted list of operations, an UnsupportedOperationException exception occurs.

4, keySet actually traversed twice, once turned Iterator objects, and once taken out from the key corresponding to the value of hashMap. The entrySet just traversed a key and value are put into the entry in higher efficiency.

5, first, frequently read out the content, suitable for use <? Extends T>. Second, often inserted inside, suitable for use <? Super T>.

Guess you like

Origin www.cnblogs.com/3chi/p/11305292.html