Answers for "kotlin cannot create an instance of an abstract class"

1

random kotlin cannot create instance of abstract class

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
Posted by: Guest on March-07-2021

Code answers related to "kotlin cannot create an instance of an abstract class"

Browse Popular Code Answers by Language