Share via


Random.Next(Int32) Method

Definition

Generates the next pseudorandom number.

[Android.Runtime.Register("next", "(I)I", "GetNext_IHandler")]
protected virtual int Next(int bits);
[<Android.Runtime.Register("next", "(I)I", "GetNext_IHandler")>]
abstract member Next : int -> int
override this.Next : int -> int

Parameters

bits
Int32

random bits

Returns

the next pseudorandom value from this random number generator's sequence

Attributes

Remarks

Generates the next pseudorandom number. This method returns an int value such that, if the argument bits is between 1 and 32 (inclusive), then that many low-order bits of the returned value will be (approximately) independently chosen bit values, each of which is (approximately) equally likely to be 0 or 1.

Added in 1.1.

Java documentation for java.util.Random.next(.*int).

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