为什么我们在Java中的数组和数组 [英] Why we have Arrays and Array in Java

查看:80
本文介绍了为什么我们在Java中的数组和数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了这两份文件:

和我想知道有什么区别这两个类之间。他们都提供了一组不同的静态方法,但他们为什么分开?有什么更深层次的区别?什么是喜欢他们阵的正常实例之间以及与相关 INT []

and I'm wondering what the difference is between these two classes. They both provide a different set of static methods, but why are they separate? What is the deeper difference? And what is the relation between them and with the normal instance of array like int[].

我注意到,他们是来自完全不同的包,但还是希望能找到一些澄清。谢谢你。

I notice that they are from totally different packages, but still hope to find some clarification. Thanks.

推荐答案

的差异是由相当清楚的文档。

The differences are made fairly clear in the docs.

从Arrays.java:

From Arrays.java:

本类包含用来操作数组的各种方法(如排序和搜索)。此类还包含一个静态工厂允许将数组作为列表来查看。

This class contains various methods for manipulating arrays (such as sorting and searching). This class also contains a static factory that allows arrays to be viewed as lists.

从Array.java

From Array.java

Array类提供静态方法动态创建和访问Java数组。

The Array class provides static methods to dynamically create and access Java arrays.

Essentialy阵列为核心的数组操作的实现 - 获取,设置和实例

Essentialy Array is an implementation of core Array operations - getting, setting and instantiation.

阵列是普通包裹业务阵列(数组和列表之间的转换,排序,搜索一个值)不污染核心阵列API一个辅助类。

Arrays is a helper class for wrapping common Array operations (conversion between Arrays and Lists, sorting, searching for a value) without polluting the core Array "api".

这篇关于为什么我们在Java中的数组和数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆