Choosing among array, arrayList, etc

I am somewhat new to Processing and Java-type syntax, but not new to programming in general. My project requires use of arrays, and I’ve been able to code everything out using for loops etc., but it’s tedious compared to what I know how to do using vectorized array helper functions in Python, R, or Matlab.

I’ve noticed in the Processing documentation that arrays have some helper functions and arrayLists or intLists have even more. After some searching around, I’ve found that array implementation in Java has even more helper functions through java.util.arrays (e.g., searching for a value and returning its index).

Can these be used in Processing? Or are we limited to the functions in the Processing documentation. Can a method from arrayList be used on an array?


The whole Java’s Standard API is available in Processing: :coffee:

Java array got its own special syntax, like its [] access operator: :face_with_monocle:

While an ArrayList is a regular class like all the rest: :flushed:

Processing got other “modes” besides default Java Mode. :+1:
Python & R modes are available to download from the PDE itself. :innocent:
There are other flavors outside the PDE, like p5js, Pjs, Ruby, etc. :sunglasses:

Although vanilla array & ArrayList (the most performant containers) are the most used containers in Java, we’ve also got HashMap, HashSet, ArrayDeque, LinkedList and many more: :money_mouth_face:

Yes I saw those, but part of the reason for learning Processing was to force myself to learn Java syntax :slight_smile:

Thanks for your answer! I think this clears up most of my confusion

Some more tips about when to use array or ArrayList: :bulb:

And general basic tutorials: :yum: