# Declaring Statements for Arrays

**URL:** <https://discourse.processing.org/t/declaring-statements-for-arrays/19984>\
**Category:** Beginners\
**Created:** [April 21, 2020, 3:50am UTC](https://discourse.processing.org/t/declaring-statements-for-arrays/19984 "2020-04-21T03:50:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![confusedstudent](https://avatars.discourse-cdn.com/v4/letter/c/c89c15/32.png) [@confusedstudent](https://discourse.processing.org/u/confusedstudent)\
**Post date:** [April 21, 2020, 3:50am UTC](https://discourse.processing.org/t/declaring-statements-for-arrays/19984/1 "2020-04-21T03:50:36Z")

</div>

How would I write the declaration statement for an array with 30 integers,

Would this be how?

```auto
int[] arr = new int[30];
int min = arr[0];
int max = arr[29];

```

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [April 21, 2020, 6:00am UTC](https://discourse.processing.org/t/declaring-statements-for-arrays/19984/2 "2020-04-21T06:00:38Z")

</div>

min would be 0 and max 29 if you see them as index

Otherwise good

Test it yourself in processing

You can fill it in a for loop with random numbers

There is a tutorial about arrays

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [April 21, 2020, 12:37pm UTC](https://discourse.processing.org/t/declaring-statements-for-arrays/19984/3 "2020-04-21T12:37:50Z")

</div>

Hello,

Get to know the resources available to you.

> **Resources \< Click here to expand !**
>
> I encourage you to review the resources available here:
> 
> - The Processing website has references, examples, tutorials, etc.  
> [https://processing.org/](https://processing.org/)
> - Those available with the Processing PDE (IDE).  
> An exploration of the tabs will reveal what is available; there are libraries and examples there.
> - The Coding Train  
> [https://www.youtube.com/channel/UCvjgXvBlbQiydffZU7m1\_aw](https://www.youtube.com/channel/UCvjgXvBlbQiydffZU7m1_aw)  
> [https://thecodingtrain.com/](https://thecodingtrain.com/)
> - Happy Coding  
> [Processing Tutorials - Happy Coding](https://happycoding.io/tutorials/processing/)
> - The Processing Foundation  
> [https://processingfoundation.org/](https://processingfoundation.org/)  
> Check out the tabs.  
> In the education tab, there is a reference to the Coding Train.

Also:

[![](https://img.youtube.com/vi/NptnmWvkbTw/maxresdefault.jpg "9.1: What is an Array? - Processing Tutorial") ](https://www.youtube.com/watch?v=NptnmWvkbTw)

[![](https://img.youtube.com/vi/47JBVxCWXJA/maxresdefault.jpg "9.2: Declare, Initialize, and Use an Array - Processing Tutorial") ](https://www.youtube.com/watch?v=47JBVxCWXJA)

`:)`
