There are resources (tutorials, examples and references) here to assist you with programming with Processing: https://processing.org/
The public static void main(String[] args) does not belong in this code.
Processing generates JAVA code in the background for you; most will never see this!
Processing Sketch Code
//global variables here
void setup()
{
size(100, 100);
//Code here
}
void draw()
{
background(128);
// Code here
}
Java Code created by Processing
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class sketch_210404b extends PApplet {
//global variables here
public void setup()
{
//Code here
}
public void draw()
{
background(128);
// Code here
}
public void settings() { size(100, 100); }
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "sketch_210404b" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}
You can look in your %temp% folder for the JAVA files that Processing generates. Again, most will never see this when working with Processing.
I have on occasion gone in there if a sketch crashes and I did not have saved code.