There are also the Java Tutorials:
https://docs.oracle.com/javase/tutorial/index.html
https://docs.oracle.com/javase/tutorial/java/concepts/index.html
The Processing website is here:
https://processing.org/
And the tutorials section of the Processing website has some great tutorials:
Objects - The basics of object-oriented programming
is one of them.
I did this (my interpretation of what you asked) last night using functions and classes as an exercise.
This a worthwhile exercise.