令牌"无效字符"上的语法错误,删除此令牌

Ava*_*Ava 7 java eclipse macos syntax-error

我不确定为什么会出现这个错误.大括号似乎是正确的.另一件事是同一个程序在Windows-eclipse中工作,但在eclipse中不适用于Mac.可能是什么原因?

import java.util.Vector;

public class Debug 
{
    private int something = 0;
    private Vector list = new Vector();

    public void firstMethod()
    {
        thirdMethod(something);
        something = something + 1;
    }
    public void secondMethod()
    {
        thirdMethod(something);
        something = something + 2;
    }
    public void thirdMethod(int value)
    {
        something = something + value;
    }

    public static void main(String[] args)
    {
        Debug debug = new Debug();
        debug.firstMethod();
        debug.secondMethod();
    }
}
Run Code Online (Sandbox Code Playgroud)

Ed *_*aub 15

啊,好吧 - 它可能是文件末尾的control-Z或其他不可打印的字符,在Windows中被忽略但在Mac上没有.您将源从Windows复制到Mac.删除最后几个字符并重新输入 - 我认为它会消失.不过我不做Mac - 我只是在猜测.