@mSolo
2015-04-26T10:27:47.000000Z
字数 1621
阅读 1147
Java
Q: What happens if two objects have the same HashCode?
Iterate through a LinkedList, calling .equals()
on the keys of each HashEntry. This is slow!
Thread Safe collection | ||
---|---|---|
Collections.unmodifiableCollection | Collections.unmodifiableSet | Collections.unmodifiableSortedSet |
Collections.unmodifiableList | Collections.unmodifiableCollection | Collections.unmodifiableMap |
Collections.unmodifiableSortedMap |
The Queues | ||
---|---|---|
ConcurrentLinkedDeque | ConcurrentLinkedQueue | LinkedBlockingQueue |
LinkedBlockingDeque | LinkedTransferQueue | PriorityBlockingQueue |
ArrayBlockingQueue |
The CopyOnWrites |
---|
CopyOnWriteArrayList |
CopyOnWriteArraySet |
- ConcurrentHashMap and HashTable( should no longer be used)
catch(Exception e) { // ... }
event()
方法表明,派生类方法可以不抛出任何异常,即使它是基类所定义的异常。同样这是因为,假使基类的方法会抛出异常,这样做也不会破会已有的程序