jvm - How can I get a random number in Kotlin? -


a generic method can return random integer between 2 parameters ruby rand(0..n)

generate random integer between from(inclusive) , to(exclusive)

import java.util.random  val random = random()  fun rand(from: int, to: int) : int {     return random.nextint(to - from) + } 

Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -