The first problem I can see is that you don't have a constructor.(Optional)
(If you don't make one the compiler makes what is called a "Default" constructor which is a constructor without any parameters. Its usually good practice to explicitly create a class constructor.
The second problem I can see is that you missing the end bracket.
Fix shown below.
public class Game
private int randomIndexX;
protected String spawn()
randomIndexX = 0;
protected String test()
You can construct it and trigger any methods you wish:
Game game = new Game();