, , :
1)
, ,
2) , , .
, , , " ", , , .
As Mehrdad notes, doing this using the Random class is not a good idea.
As he also notes, redundant parentheses make it less concise; if you are not in the dusty corner of a language, assume that competent programmers know the priority of the language operator. In this case, even if I don’t know the priority of the operator, alternative parsing (calling new on the return function) is pointless, so the “obvious” reading is the correct reading.
int RandomIndex = (new Random()).Next(0,100);
int RandomIndex = new Random().Next(0,100);
source
share