What exactly was the error? Assuming you are using ASCII on your keyboard, it will have picked up the { correctly.
A chap called Roedy Green has a list of compiler errors, which are worth looking at, because the standard compiler produces error messages difficult to understand.
It puts a caret
^ at the last position where it thinks the code is correct, so you need to look after your { for the error.
Welcome to the Ranch.
I would suggest you go to
this website and download JCreatorLE, which is available as freeware, and is much better as a text editor than a plain editor. It will pair off {} and () for example, which will prevent much confusion with compiler errors. You can even run the classes from build->execute on JCreator. It is part of an
IDE, but is easier for a beginner to use than a full-blown IDE (most people use Eclipse or NetBeans).
CR