ThreadLocalRandom.NextLong Method

Definition

Overloads

NextLong(Int64)

Returns a pseudorandom long value between zero (inclusive) and the specified bound (exclusive).

NextLong(Int64, Int64)

Returns a pseudorandom long value between the specified origin (inclusive) and the specified bound (exclusive).

NextLong(Int64)

Returns a pseudorandom long value between zero (inclusive) and the specified bound (exclusive).

[Android.Runtime.Register("nextLong", "(J)J", "GetNextLong_JHandler")]
public virtual long NextLong (long bound);
[<Android.Runtime.Register("nextLong", "(J)J", "GetNextLong_JHandler")>]
override this.NextLong : int64 -> int64

Parameters

bound
Int64

the upper bound (exclusive). Must be positive.

Returns

a pseudorandom long value between zero (inclusive) and the bound (exclusive)

Attributes

Exceptions

if n is not positive

Remarks

Returns a pseudorandom long value between zero (inclusive) and the specified bound (exclusive).

Java documentation for java.util.concurrent.ThreadLocalRandom.nextLong(long).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

NextLong(Int64, Int64)

Returns a pseudorandom long value between the specified origin (inclusive) and the specified bound (exclusive).

[Android.Runtime.Register("nextLong", "(JJ)J", "GetNextLong_JJHandler")]
public virtual long NextLong (long origin, long bound);
[<Android.Runtime.Register("nextLong", "(JJ)J", "GetNextLong_JJHandler")>]
override this.NextLong : int64 * int64 -> int64

Parameters

origin
Int64

the least value returned

bound
Int64

the upper bound (exclusive)

Returns

a pseudorandom long value between the origin (inclusive) and the bound (exclusive)

Attributes

Exceptions

if least greater than or equal to bound

Remarks

Returns a pseudorandom long value between the specified origin (inclusive) and the specified bound (exclusive).

Java documentation for java.util.concurrent.ThreadLocalRandom.nextLong(long, long).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to