Possible Duplicate:
How to pass a function as a parameter in Java?
How can i give a function as parameter?
for example:
for(Confetti c : confetti) { b.draw(someFunction(){strokeWeight(random(10)); } where in the confetti class there would be something like
draw(void myFunc){ for(int i = 0; i < 10; i++) { myFunc(); // run it ellipse(50, 50, 5, 5); } }