java 非法字符u3000,非法字符错误:'\ u200b'

本文介绍了一位学生在编写Object-Oriented Programming课程中的Asteroid Game时遇到的'​'非法字符错误,问题在于第12行的空行。解决方法是删除该空行,保存文件后再重新添加。关键在于识别并处理Unicode的零宽度空间。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

{

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 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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值