java - java vector 方法set()和setElementAt()有什么区别?

标签 java api vector

在 google 上找不到任何真正的答案。

最佳答案

文档清楚地说明了这一点:

[setElementAt] is identical in functionality to the set(int, E) method (which is part of the List interface). Note that the set method reverses the order of the parameters, to more closely match array usage. Note also that the set method returns the old value that was stored at the specified position.

http://download.oracle.com/javase/6/docs/api/java/util/Vector.html

编辑:我在 Google 中搜索 Java 文档的方式非常简单。我输入 java 6 api String (将 String 替换为您想知道的任何类),它通常是第一个命中。

关于java - java vector 方法set()和setElementAt()有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4346993/

相关文章:

java - 按位右移和 0xFF | java

ios - 如何在swift中将Data转换为Int

php - 如何在 Wordpress 中集成第三方 API

javascript - 使用 Node.js 和 Express 进行简单的 API 调用

matlab - 在另一个向量 matlab 中查找向量的一部分

c++ - 使用 getline 读取文件时将值迭代到 vector 中

java - 在单链表中查找倒数第三个元素 - 算法

java - NDK如何获取dvm点?

java - 网络线程和 Swing 线程出现问题

c++ - 我们可以控制 vector 数组(c++)中元素的内存分配吗?