繁体   English   中英

非法字符错误:'\​'

[英]Illegal Character error: '\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);
    }
}

\​是 Unicode 中的“零宽度空间”。

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

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

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

脚步:

1- Ctrl + r替换(勾选正则表达式复选框)

2- 粘贴字符代码:\​

3-全部替换为空

完毕!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM