Error in my code :(

I’ve just recently started coding and it says “unexcpected token: void” what’s up with my code? (it’s not finished yet, i’m just trying to run it)

Star[] stars = new Star[100]

void setup() {
for (int i = 0; i < stars.length; i++) {
stars[i] = new Star();

void draw() {
for (int i = 0; i < stars.length; i++) {



Hello and welcome,

Your error is in this line. missing the semi-colon at end of line…


Also, FYI, when you see an error message like this

the program is looking for semi-colon prior to a void function, and can’t find it. Hence the error message.


1 Like

thank you so much! I’ve only been coding for a couple of days so any help is tremendously appriciated!!


@noahgabeschaun – Welcome to the forum! When you post, please help us help you by formatting your code with the </> button or by adding ``` above and below. You can still edit your top post to fix it.