JS1109: Class definition not allowed in this context
A class declaration exists in an inappropriate context. Class declarations are allowed only in the main program block, inside other classes, inside packages, or in functions.
To correct this error
Define the class in the main program block, inside another class, inside a package, or in a function.