The first thing you should do is to indent your code so the { symbols and the } symbols match up vertically. Then, since the error is caused because you don't have enough of one or the other kind of those symbols, it should be easier to find out where you missed one. If you are using an IDE like Netbeans or Eclipse then there's an option you can take to reformat your class.
As it is you have several hundred lines of code which is less readable than it should be. This problem is the consequence of having unreadable code.
Is that all in the main() method? Good grief! Any method that long ought to be divided into several methods.
Also that whole thing is non object-oriented; you ought to have classes for CPU, memory, etc.
Teh Singh wrote:Ive counted every { and } and they are equal...
Sure, but they are in the wrong order. I still suggest you format your code better. Even if you find your problem now, it will be easy for you to break it again and have the same problem.
This is why you don't write 300 lines of code before you compile. My guess is that you have something like this:
You'll notice I have the correct number of curly braces, but this code would be invalid. You have to close one method before you start the next. So my above example would be correctly written as this:
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Teh Singh wrote:Problem is i aint learnt that far yet in college
and have half term but trying to finsih my program and have no idea how to have seperate classes for them etc.
Your main method is from line 5 till 393, within this method you have another method printheader between line 267 and 276. That's causing the error. If you put the method outside of main and use it you can remove 87 lines of code from the main .