Java中的容器是什么

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1288708/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-12 07:48:45  来源:igfitidea点击:

What are the containers in Java

javacontainers

提问by derrdji

Could anyone please give me a brief full list of containers in Java? Some of the ones I know are Array, Arraylist, Hashtable, HashMap, HashSet, Node, NodeList, TreeNode, and TreeMap.

谁能给我一份完整的 Java 容器列表?我知道的一些是 Array、Arraylist、Hashtable、HashMap、HashSet、Node、NodeList、TreeNode 和 TreeMap。

采纳答案by Chii

Essentially, all the docs about java "containers", or better known as collections, is here, with the most useful page being this one, brief list here. There are other implementations of the collections framework, like the fastutils frameworkthat gives better performance if you knew the type you were going to use. Also Gnu Troveis another one similar to fastutils.

本质上,所有关于 java“容器”的文档,或者更广为人知的集合,都在这里,最有用的页面是这个这里的简要列表。集合框架还有其他实现,例如fastutils 框架,如果您知道要使用的类型,它会提供更好的性能。另外Gnu Trove是另一个类似于 fastutils 的。

回答by Sebastian Paaske T?rholm

A good start is looking at which classes implement Collection<E>and Map<K,V>.

一个好的开始是查看哪些类实现了Collection<E>Map<K,V>

回答by jtbradle

I don't know if I can give you a complete exhaustive list, but I believe most of the standard Java API containers should reside in the java.util package.

我不知道我是否可以给你一个完整详尽的列表,但我相信大多数标准 Java API 容器应该驻留在 java.util 包中。

回答by yalestar

Have a look-see at the Java Collections API, and at this pagefor more information

查看Java Collections API此页面以获取更多信息

回答by dfa

You can check at official Sun tutorial.

您可以查看官方Sun 教程

EDIT

编辑

Check also the Google Collections library:

另请检查Google Collections 库

The Google Collections is a set of new collection types, implementations and related goodness for Java 5 and higher, brought to you by Google. It is a natural extension of the Java Collections Framework you already know and love.

Google Collections 是一组由 Google 为您提供的适用于 Java 5 及更高版本的新集合类型、实现和相关优点。它是您已经熟悉和喜爱的 Java 集合框架的自然扩展。

Edit: There was a very nice cheatsheet for Java Collectionswhich is not available anymore. There are lots of others though, like this one.

编辑:Java 集合有一个非常好的备忘单,现在已经不可用了。不过还有很多其他的,比如这个

回答by grepit

"Containers are the interface between a component and the low-level platform-specific functionality that supports the component. Before a web component, enterprise bean, or application client component can be executed, it must be assembled into a Java EE module and deployed into its container." here is my source : http://docs.oracle.com/javaee/1.4/tutorial/doc/Overview3.html

“容器是组件和支持该组件的低级平台特定功能之间的接口。在执行 Web 组件、企业 bean 或应用程序客户端组件之前,必须将其组装到 Java EE 模块中并部署到它的容器。” 这是我的来源:http: //docs.oracle.com/javaee/1.4/tutorial/doc/Overview3.html