title: Same random numbers from instantiated class
body: <p>I'm learning C# and created a class within my program that holds a random number generator:</p>
  
  <pre><code>class RandomNumberGenerator
  {
      Random RNG = new Random();
      // A bunch of methods that use random numbers are in here
  }
  </code></pre>
  
  <p>Inside this class are a few methods that use the RNG.  Data gets sent here from other parts of the program, gets processed, then gets returned.  One of the methods does the following:</p>
  
  <pre><code>// Method works something like this
  int Value1 = RNG.Next(x, y);
  int Value2 = RNG.Next(x, y);
  int Value3 = RNG.Next(x, y);
  </code></pre>
  
  <p>The <code>x</code>, <code>y</code> values are to be sent here from another class. So, I have to create an instance of the <code>RandomNumberGenerator</code> within that class so I can call its methods and pass the x and y values to it.</p>
  
  <pre><code>class DoStuff
  {
      RandomNumberGenerator Randomizer = new RandomNumberGenerator
      // Here I call a bunch of Randomizer methods that give me values I need
  }
  </code></pre>
  
  <p>The problem in the above method is that I get the same numbers every time for all three values. I'm not sure if it's because they're so close together and <code>Randomizer</code>'s seed value hasn't had time to change or if I'm doing something wrong when I create a new instance of the <code>RandomNumberGenerator</code> class.</p>
  
  <p>I've gone through a bunch of answers on here already and typically problems like this are due to people creating many new <code>Random</code> objects when they run methods (thus setting the seed for all of them to the same value), but the only new <code>Random</code> object I create is within the <code>RandomNumberGenerator</code> class.  I then instantiate that once within the other class so I can pass it data and use its methods.</p>
  
  <p>Why is this happening and how would I fix this?</p>