C# Random Equals(Object)
Description
Random Equals(Object)
determines whether the specified
object is equal to the current object.
Syntax
Random.Equals(Object)
has the following syntax.
public virtual bool Equals(
Object obj
)
Parameters
Random.Equals(Object)
has the following parameters.
obj
- The object to compare with the current object.
Returns
Random.Equals(Object)
method returns true if the specified object is equal to the current object; otherwise, false.
Example
The following code shows how to use Random.Equals(Object)
method.
/* w ww. j a v a 2 s. c om*/
using System;
public class RandomNumbers
{
public static void Main()
{
Random rand1 = new Random();
Random rand2 = new Random();
Console.Write(rand1.Equals(rand2));
}
}
The code above generates the following result.