Trying to create a random number between 0 and 10 using the following code:
However, when I try to compile it I get the following error:Code:using System; class Random { public static void Main() { Random rand = new Random(); Console.WriteLine(rand.Next(0,10)); } }
Any idea why? I can't seem to figure it out and it's driving me insane!random.cs(7,32): error CS1061: 'Random' does not contain a definition for 'Next'
and no extension method 'Next' accepting a first argument of type
'Random' could be found (are you missing a using directive or an
assembly reference?)


LinkBack URL
About LinkBacks
Reply With Quote
