ethn_da_ninja
ethn_da_ninja

Reputation: 9

What is the cause of Syntax error, insert "}" to complete Statement and how is it fixed?

I am relatively new to java and am coding a game. It was going quite well until I ran into an error under a } and a ; saying

Syntax error, insert "}" to complete Statement 

(with a ; for the ;). I am wondering what creates syntax errors, what are they and how are they fixed. I would apreciate any feedback and understand if this is a dumb question. Thanks.

Upvotes: -1

Views: 1083

Answers (1)

Tom Wellbrock
Tom Wellbrock

Reputation: 3042

Syntax errors are errors on compile-time. It means that your compiler is seeing a gravure mistake in your Syntax and therefore will not compiling your code. Now to your specific errormessage:

-every task in Java ends with a semicolon ";". -the body of classes, methods and iterations is define with curly braces "{","}".

if your Syntax error tells you, that your method/classbody is not closed and you have to insert a curly brace "}" to do so, than there is no room for questions at all!

I dont want to further explain this stuff, because thats the VERY basic and is written in every java tutorial!

Upvotes: 1

Related Questions