我的编码是到1000范围为1至创建随机100的质数,但我得到了一个错误信息The operator > is undefined for the argument type(s) Integer, int,在
Integer date;
int count = 0;
for (int i = 0; i < 100; i++)
{
date = new Integer(value.nextInt(1000));
if(date > 1 && prime(date) != -1)`
tree.add(date);
}
Run Code Online (Sandbox Code Playgroud)
我猜它会产生错误,因为我们不能说整数> 1?但那我们该怎么说呢?
因为prime(date) != -1),我不清楚这是什么意思,看起来不必要.
我不知道这意味着什么:
this.x = x < 0 ? 0 : x;
this.y = y < 0 ? 0 : y;
Run Code Online (Sandbox Code Playgroud)
我找不到这些运营商的意思,任何帮助都将不胜感激!