Field or method declaration expected

Inside a class declaration, only field or method declarations are allowed.

class Test {
  x = x + 3  ; Error!
}

See Also
Errors