3
这些方法返回已备份集,因为在一个集合变化影响的其他集合。[样的直写过程]Java中的Backed Collection是什么?
headSet(e, b) Returns a subset ending at element e and exclusive of e headMap(k, b) Returns a submap ending at key k and exclusive of key k tailSet(e, b) Returns a subset starting at and inclusive of element e tailMap(k, b) Returns a submap starting at and inclusive of key k subSet(s, b, e, b) Returns a subset starting at element s and ending just before element e subMap(s, b, e, b) Returns a submap starting at key s and ending just before key e
那有什么用Arrays.asList()
方法的差异?该方法将数组复制到List中。API说“对返回列表的更改'通过'写入数组&反过来”。
那么,它是一个支持的集合吗?如果是,那么List接口中的toArray()方法 - 也是一个Backed集合?
是否有其他方法,如Arrays.asList()
,它允许通过写?如何才能知道该方法是否允许通过写或不通过查看方法签名?
+1你可能想提一下经常使用的'keySet' /'values'和mapMap的headMap' /'subMap' /'tailMap'视图。 – dasblinkenlight
好吧,公平的说,'headMap','subMap'和'tailMap'已经被OP提及。 –
你是对的,他做到了!我没有阅读这个问题中的例子列表,所以我错过了这三个。 – dasblinkenlight