Declaring Statements for Arrays

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

Would this be how?

int[] arr = new int[30];
int min = arr[0];
int max = arr[29];
1 Like

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

1 Like


Get to know the resources available to you.

Resources < Click here to expand !

I encourage you to review the resources available here:



1 Like