this.rnum = Math.random()*100+10;这句什么意思啊,在代码中起什么作用?

来源:学生作业帮助网 编辑:六六作业网 时间:2024/05/31 00:20:39
this.rnum=Math.random()*100+10;这句什么意思啊,在代码中起什么作用?this.rnum=Math.random()*100+10;这句什么意思啊,在代码中起什么作用?th

this.rnum = Math.random()*100+10;这句什么意思啊,在代码中起什么作用?
this.rnum = Math.random()*100+10;这句什么意思啊,在代码中起什么作用?

this.rnum = Math.random()*100+10;这句什么意思啊,在代码中起什么作用?
这是个赋值语句,this 只某个类 rnum 是这个类的属性 math.random()*100+10 是得到一个随机数然后*100+10 把这个结果赋值给属性RNUM