# Differentiating Array definitions

**URL:** <https://discourse.processing.org/t/differentiating-array-definitions/5834>\
**Category:** Coding Questions\
**Created:** [November 22, 2018, 8:31pm UTC](https://discourse.processing.org/t/differentiating-array-definitions/5834 "2018-11-22T20:31:28Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [November 22, 2018, 9:07pm UTC](https://discourse.processing.org/t/differentiating-array-definitions/5834/2 "2018-11-22T21:07:53Z")

</div>

> [@How to copy an array](https://discourse.processing.org/t/how-to-copy-an-array/5170/4):
>
> Just directly invoke method [clone()](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#clone()) over the array container: nerd_face class Testos { final float[] a, b; Testos(final float... arr) { b = (a = arr).clone(); } }

> [@Array Index Out of Bounds error on Array List](https://discourse.processing.org/t/array-index-out-of-bounds-error-on-array-list/3006/5):
>
> String[] originalArray = { "apple", "orange", "grape", "banana", "lemon" }; String[] clonedArray = originalList.clone();

---

_[View the full topic](https://discourse.processing.org/t/differentiating-array-definitions/5834)._
