Collections
collection
storing a collection of elements
- set : store a group of nonduplicate elements.
- list : store an ordered collection of elements.
- stack : store objects that are processed in a last-in,first-out fashion.
- queue : store objects that are processed in a fiest-in,first-out fashion.
- PriorityQueue : store objects that are processed in the order of their priorities.
List
duplicates allowed
common methods
in the List interface
add(index,element);
addAll(index,collection);
remove(index);
indexOf(element); //obtain the index of the specified element's first occurrence
lastIndexOf(element);
subList(fromIndex,toIndex);//obtain the sublist
ArrayList
LinkedList
map
storing key/value pairs
最后
以上就是知性睫毛膏最近收集整理的关于List,Stacks,Queues,and Priority QueuesCollections的全部内容,更多相关List,Stacks,Queues,and内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复