You don't have a constructor nor any methods. You need to put it inside either a constructor or a method.

Preferably a constructor if that's the entire class.

Not sure what you mean by...