📜  随机 kotlin 无法创建抽象类的实例 - 无论代码示例

📅  最后修改于: 2022-03-11 14:59:26.780000             🧑  作者: Mango

代码示例1
Just remove the parentheses: Random.nextInt(7).

Like this it uses the companion object (Default) of 
class Random which implements the abstract class Random with a 
default behaviour.

From the documentation:
The companion object Random.Default is the default instance of Random