Partager via


IRandomGenerator.NextInt Method

Definition

Overloads

NextInt()

Returns a pseudorandomly chosen int value.

NextInt(Int32)

Returns a pseudorandomly chosen int value between zero (inclusive) and the specified bound (exclusive).

NextInt(Int32, Int32)

Returns a pseudorandomly chosen int value between the specified origin (inclusive) and the specified bound (exclusive).

NextInt()

Returns a pseudorandomly chosen int value.

[Android.Runtime.Register("nextInt", "()I", "GetNextIntHandler:Java.Util.RandomGenerators.IRandomGenerator, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=35)]
public virtual int NextInt ();
[<Android.Runtime.Register("nextInt", "()I", "GetNextIntHandler:Java.Util.RandomGenerators.IRandomGenerator, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=35)>]
abstract member NextInt : unit -> int
override this.NextInt : unit -> int

Returns

a pseudorandomly chosen int value

Attributes

Remarks

Returns a pseudorandomly chosen int value.

Java documentation for java.util.random.RandomGenerator.nextInt().

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

NextInt(Int32)

Returns a pseudorandomly chosen int value between zero (inclusive) and the specified bound (exclusive).

[Android.Runtime.Register("nextInt", "(I)I", "GetNextInt_IHandler:Java.Util.RandomGenerators.IRandomGenerator, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=35)]
public virtual int NextInt (int bound);
[<Android.Runtime.Register("nextInt", "(I)I", "GetNextInt_IHandler:Java.Util.RandomGenerators.IRandomGenerator, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=35)>]
abstract member NextInt : int -> int
override this.NextInt : int -> int

Parameters

bound
Int32

the upper bound (exclusive) for the returned value. Must be positive.

Returns

a pseudorandomly chosen int value between zero (inclusive) and the bound (exclusive)

Attributes

Remarks

Returns a pseudorandomly chosen int value between zero (inclusive) and the specified bound (exclusive).

Java documentation for java.util.random.RandomGenerator.nextInt(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

NextInt(Int32, Int32)

Returns a pseudorandomly chosen int value between the specified origin (inclusive) and the specified bound (exclusive).

[Android.Runtime.Register("nextInt", "(II)I", "GetNextInt_IIHandler:Java.Util.RandomGenerators.IRandomGenerator, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=35)]
public virtual int NextInt (int origin, int bound);
[<Android.Runtime.Register("nextInt", "(II)I", "GetNextInt_IIHandler:Java.Util.RandomGenerators.IRandomGenerator, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=35)>]
abstract member NextInt : int * int -> int
override this.NextInt : int * int -> int

Parameters

origin
Int32

the least value that can be returned

bound
Int32

the upper bound (exclusive) for the returned value

Returns

a pseudorandomly chosen int value between the origin (inclusive) and the bound (exclusive)

Attributes

Remarks

Returns a pseudorandomly chosen int value between the specified origin (inclusive) and the specified bound (exclusive).

Java documentation for java.util.random.RandomGenerator.nextInt(int, 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