# Error in my code :(

**URL:** <https://discourse.processing.org/t/error-in-my-code/18468>\
**Category:** Beginners\
**Created:** [March 7, 2020, 12:20am UTC](https://discourse.processing.org/t/error-in-my-code/18468 "2020-03-07T00:20:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![noahgabeschaun](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noahgabeschaun/32/8316_2.png) [@noahgabeschaun](https://discourse.processing.org/u/noahgabeschaun)\
**Post date:** [March 7, 2020, 12:20am UTC](https://discourse.processing.org/t/error-in-my-code/18468/1 "2020-03-07T00:20:35Z")

</div>

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() {  
size(400,400);  
for (int i = 0; i \< stars.length; i++) {  
stars[i] = new Star();  
}  
}

void draw() {  
background(0);  
for (int i = 0; i \< stars.length; i++) {  
stars[i].update();  
stars[i].show();

}

}

---

<div class="post-metadata">

**Author:** ![debxyz](https://avatars.discourse-cdn.com/v4/letter/d/58956e/32.png) [@debxyz](https://discourse.processing.org/u/debxyz)\
**Post date:** [March 7, 2020, 12:27am UTC](https://discourse.processing.org/t/error-in-my-code/18468/2 "2020-03-07T00:27:08Z")

</div>

Hello and welcome,

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

> [@noahgabeschaun](#):
>
> Star stars = new Star[100]

---

<div class="post-metadata">

**Author:** ![debxyz](https://avatars.discourse-cdn.com/v4/letter/d/58956e/32.png) [@debxyz](https://discourse.processing.org/u/debxyz)\
**Post date:** [March 7, 2020, 12:33am UTC](https://discourse.processing.org/t/error-in-my-code/18468/3 "2020-03-07T00:33:31Z")

</div>

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

> [@noahgabeschaun](#):
>
> “unexcpected token: void”

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

🙂

---

<div class="post-metadata">

**Author:** ![noahgabeschaun](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noahgabeschaun/32/8316_2.png) [@noahgabeschaun](https://discourse.processing.org/u/noahgabeschaun)\
**Post date:** [March 7, 2020, 12:35am UTC](https://discourse.processing.org/t/error-in-my-code/18468/4 "2020-03-07T00:35:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [March 7, 2020, 10:38pm UTC](https://discourse.processing.org/t/error-in-my-code/18468/5 "2020-03-07T22:38:53Z")

</div>

@noahgabeschaun – Welcome to the forum! When you post, please help us help you by [formatting your code](https://discourse.processing.org/faq#format-your-code) with the \</\> button or by adding ``` above and below. You can still edit your top post to fix it.
