Name |
append()添加数据 |
||||
Examples |
String[] sa1 = { “OH”, “NY”, “CA”}; String[] sa2 = append(sa1, “MA”); println(sa2); // Prints updated array contents to the console: // [0] “OH” // [1] “NY” // [2] “CA” // [3] “MA” |
||||
Description |
Expands an array by one element and adds data to the new position. The datatype of the elementparameter must be the same as the datatype of the array. When using an array of objects, the data returned from the function must be cast to the object array’s data type. For example: SomeClass[] items = (SomeClass[]) append(originalArray, element) 按一个元素展开数组, 并将数据添加到新位置。elementparameter 的数据类型必须与数组的数据类型相同。
当使用对象数组时, 从函数返回的数据必须转换为对象数组的数据类型。例如: SomeClass [] 项 = (SomeClass []) 追加 (originalArray, 元素) |
||||
Syntax |
append(array, value) |
||||
Parameters |
|
||||
Returns |
byte[], char[], int[], float[], String[], or Object |
||||
Related |
shorten() |
- 本文固定链接: http://iprocessing.cn/2017/07/21/append添加数据/
- 转载请注明: 卡萨布兰卡 于 Processing编程艺术 发表