gpt4 book ai didi

java - token "Invalid Character"语法错误,删除此 token

转载 作者:塔克拉玛干 更新时间:2023-11-03 04:05:21 25 4
gpt4 key购买 nike

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

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();
}
}

最佳答案

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

关于java - token "Invalid Character"语法错误,删除此 token ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7129371/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com