# Vague error on enums at runtime

**URL:** <https://discourse.processing.org/t/vague-error-on-enums-at-runtime/614>\
**Category:** Coding Questions\
**Created:** [June 2, 2018, 1:10am UTC](https://discourse.processing.org/t/vague-error-on-enums-at-runtime/614 "2018-06-02T01:10:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![StrawberrEclair](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/strawberreclair/32/304_2.png) [@StrawberrEclair](https://discourse.processing.org/u/StrawberrEclair)\
**Post date:** [June 2, 2018, 1:10am UTC](https://discourse.processing.org/t/vague-error-on-enums-at-runtime/614/1 "2018-06-02T01:10:29Z")

</div>

**Note** : this is Processing 3.3.6

I’ve just started a project, and part of it requires enums. I’ve done my research and found that in order to have enums, they need to be in a seperate .java file. I’ve done that, but at runtime, I get the error `Syntax error on token "{", @ expected after this token` on line one. I tried humoring it, and adding a single @, but it only continued throwing similar errors. From what I can tell, mind you it has been sometime since I’ve worked with enums, the syntax is perfectly fine. It may also be of not that the code below is the only code contained in its file. So, what’s causing the error?

```auto
public enum TileType{
  PLAINS({100,255,125}, true),
  FOREST({15,150,25}, true),
  MOUNTAIN({120, 110, 25}, false),
  CAVE({50, 40, 25}, true),
  DESERT({170, 175, 75}, true),
  VILLAGE({95, 60, 0}, true),
  OCEAN({35, 45, 180}, false),
  RIVER({35, 125, 180}, true);
  
  private int[] tileColor;
  private boolean isPassable;
  
  private TileType(int[] tileColor, boolean isPassable){
    this.tileColor = tileColor;
    this.isPassable = isPassable;
  }
  
  public int[] getTileColor(){
    return tileColor;
  }
  
  public boolean getIsPassable(){
    return isPassable;
  }
  
}

```

---

<div class="post-metadata">

**Author:** ![colouredmirrorball](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/colouredmirrorball/32/234_2.png) [@colouredmirrorball](https://discourse.processing.org/u/colouredmirrorball)\
**Post date:** [June 2, 2018, 1:20am UTC](https://discourse.processing.org/t/vague-error-on-enums-at-runtime/614/2 "2018-06-02T01:20:48Z")

</div>

I’m not familiar with enums in any way, but it might have something to do with the arrays in the constructors in the enum. Try adding the `new` keyword.

```auto
enum TileType{
  PLAINS(new int[] {100,255,125}, true),
  // etc.

```

---

<div class="post-metadata">

**Author:** ![StrawberrEclair](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/strawberreclair/32/304_2.png) [@StrawberrEclair](https://discourse.processing.org/u/StrawberrEclair)\
**Post date:** [June 2, 2018, 1:23am UTC](https://discourse.processing.org/t/vague-error-on-enums-at-runtime/614/3 "2018-06-02T01:23:01Z")

</div>

@colouredmirrorball  
Wow, this was it! Real helpful error message there 🙄. Thank you!
