How to Correct a Java Error Message of Illegal Statement
- 1). Open your Java program's source code in a text editor or Integrated Development Environment (IDE).
- 2). Scroll down to the line of code where the compiler reported an error.
- 3). Check to make sure that your statement ends in a semi-colon and that all braces, brackets and parentheses have a proper beginning and end.
- 4). Check to make sure that if you are creating a new object that you have done so using the proper "new Name()" syntax.
- 5). Check to make sure that any strings on the line have the proper opening and closing quotation marks.