我是靠谱客的博主 知性睫毛膏,这篇文章主要介绍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内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(40)

评论列表共有 0 条评论

立即
投稿
返回
顶部