Illegal Character error: '\u200b'

Illegal Character error: '\u200b'

我在我的面向对象编程中为小行星游戏制作小行星场 class,我收到一个非法字符错误:'\u200b'。这个问题似乎发生在第 12 行。(import java.awt.Point; 和 public class Asteroid extends PolyBlob 之间的线)

/*
 * University of Central Florida
 * COP3330 - Spring 2016
 * Author: Aundray Ortiz
 */
package asteroidfield;

import java.util.Random;
import blobzx.PolyBlob;
import blobzx.BlobUtils;
import java.awt.Point;
​
public class Asteroid extends PolyBlob
{
    private static final Random random = new Random();

    public Asteroid(int a, int b, double c)
    {
        super(-100,-100,c);
        int sides = 5 + random.nextInt(5);
        int[] x = new int[sides];
        int[] y = new int[sides];
        int going = 0;
        double direct = 0;
        double region = (Math.PI * 2)/sides;
        for(int num = 0; num<sides;num++)
        {
            going = 5 + random.nextInt(16);
            direct = (num * region) + (Math.random() * region);
            Point p = BlobUtils.rotatePoint(going, direct);
            x[num] = p.x;
            y[num] = p.y;
        }

        setPolygon(x, y);
        setRate(c);
        setDelta(a,b);
    }
}

\u200b 是 Unicode 中的 "zero-width-space"。

您应该删除第12行(空白行),保存文件,重新添加空白行并再次保存。使用简单的文本编辑器。

如果这不能解决问题,请删除第 11 行和第 13 行并重新创建它们。

我认为这里的重点是不要重新输入复制的代码。所以考虑到这一点:

步骤:

1- Ctrl + r 替换(勾选 Regex 复选框)

2-粘贴字符代码:\u200b

3-全部替换为空

完成!