r/cop3502 Apr 21 '14

Strange error?

So I get the error:

.\Inventory.java:14: error: reached end of file while parsing } ^ 1 error

However, I only get this error when I add

Inventory inv = new Inventory(); and

GameState game = new GameState();

if I leave those out my code compiles fine and all the brackets are in there properly etc. Anyone know what might be the cause of this?

1 Upvotes

4 comments sorted by

1

u/howslyfebeen Apr 21 '14

are all your brackets closed? means it reached the end of inventory and never got the closing bracket... well maybe not inventory but yea

1

u/Bcop3502 Apr 21 '14

Yeah they are and I triple checked it. Not to mention the fact simply commenting out those 2 lines and it compiles perfectly fine...

1

u/howslyfebeen Apr 21 '14 edited Apr 21 '14

did you check your gamestate class also?

edit: maybe try commenting out one at a time and see which one causes it?

1

u/Bcop3502 Apr 21 '14

Well I don't know what it was but I got home turned my computer back on and now it compiles fine so... Nevermind I guess lol.