cannot create an instance of an abstract class kotlin code example
Example: 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