Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
609 views
in Technique[技术] by (71.8m points)

java - Illegal Character error: 'u200b'

I'm making an Asteroid Field for an Asteroid Game in my Object Oriented Programming class and I am receiving an illegal character error: 'u200b'. The issue seems to be happening on line 12. (The line between import java.awt.Point; and 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);
    }
}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

u200b is a "zero-width-space" in Unicode.

You should delete line 12 (the blank line), save the file, re-add the blank line and save again. using a simple text editor.

If that doesn't fix it delete lines 11 and 13 as well and recreate them.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...