C
Curious
Hi,
I am writing a class Distribution that inherits from Random class
public class Distribution : System.Random
{
public int Uniform(int min, int max)
{
return this.Uniform(min, max);
}
}
Now I wrote the new Uniform method, and I'm acessing the base method
having this name.
When I execute the application, a runtime error is given:
StackOverflowEception.
Distribution d = new Distribution();
d.Uniform(0, 5);
Can someone give some help regarding this method, because I cannot find
anything about it on the net.
Thanks in Advance
I am writing a class Distribution that inherits from Random class
public class Distribution : System.Random
{
public int Uniform(int min, int max)
{
return this.Uniform(min, max);
}
}
Now I wrote the new Uniform method, and I'm acessing the base method
having this name.
When I execute the application, a runtime error is given:
StackOverflowEception.
Distribution d = new Distribution();
d.Uniform(0, 5);
Can someone give some help regarding this method, because I cannot find
anything about it on the net.
Thanks in Advance