Syntax error on token(s), misplaced construct(s)

You need to place all statements after the declarations in a code block, e.g. method rather than the class block. Logically it probably makes sense to place all statements in the code block but the non-declarative statements need to be enclosed within the new block private void processFile() { data.put(“1”, new Object[]{“ID”,”NAME”, “LASTNAME”}); // <–Syntax … Read more

Syntax error on token “;”, { expected after this token in Random string creator

In Java, you cannot directly write the executable statements in class. You need to move your code in a method. Only variables declaration is allowed outside the method/blocks. Just for the sake of testing, ,move everthing to main method. Try this: public class Orders { public static void main(String argsp[]) { String alphabet = “abc”; … Read more