Syntax error: insert} to end ClassBody

I created a method and get an error message that I need to include at the end of my method. I put} and the error is still there! If I remove this, the same error will appear according to the previous method; and this error did not exist before. in other words, if I type} in my last method, then the error remains there and only there. if I remove it, it duplicates this error in my previous method.

private void putThreeBeepers() {
for (int i = 0; i < 2; i++) {
    putBeeper();
    move();
}
putBeeper();
}
private void backUp() {
turnAround();
move();
turnAround();
   }
+5
source share
9 answers

You really want to go to the beginning of your file and make a correct and consistent digression to the end.

For instance...

private void putThreeBeepers() 
{
    for (int i = 0; i < 2; i++) {
        putBeeper();
        move();
    }

    putBeeper();
}

private void backUp() 
{
    turnAround();
    move();
    turnAround();
}

, - , }. , , , - , , , - -... .

, , , , .

+5

. / , , , :

/*
//  */
*/

. . .

+4

, .: (

. , :  onUpgrade (SQLiteDatabase pDb, pOldVersion, pNewVersion) {

} :  onUpgrade (SQLiteDatabase pDb, int pOldVersion, int pNewVersion)

+2

- PDF-. .

" " → .

Invisible Chars when copying code from PDF ebook

+1

, , if . , .

0

"}", "}}",

"}" java-.

Im java beginner, , .

0

. , . , :

private Texture foo;
private Sprite bar;
foo = new Texture();
bar = new Sprite();

, foo bar .

foo = new Texture();
bar = new Sprite();

(, ), .

private Texture foo;
private Sprite bar;
// function
public void instantiateVariables(){
foo = new Texture();
bar = new Sprite();
}
0
source

I got this error due to a lack <%.

0
source

Here are the steps.

  • Just copy your code to notepad
  • Delete copy from Java file
  • Copy the notepad again and paste it into the Java file.
  • The error will disappear.
0
source

All Articles