我是靠谱客的博主 知性睫毛膏,最近开发中收集的这篇文章主要介绍List,Stacks,Queues,and Priority QueuesCollections,觉得挺不错的,现在分享给大家,希望可以做个参考。
概述
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 Priority QueuesCollections所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复