The instance member 'random' can't be accessed in an initializer. Try replacing the reference to the instance member with a different expression

后端 未结 0 537
灰色年华
灰色年华 2020-12-04 05:30

This error occur when i try to pass the random value to my wordslist.

var random = Random().nextInt(wordslist.length);
String word = wordslist[random];


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题