When you use the System.Random
class, you must make an instance of it. Why is it not static
? Because if I want a random number between 0 and 9, I can use the static method, System.Random.Next(int, int)
:
int ourRandomNumber = Random.Next(0,9);
So why isn't the class just static
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…