title: Error - The name does not exist in the current context
body: <p>I am new to programming and am having trouble getting this piece of code to work.
  The fillPositive method should fill an array of size n with numbers 1-n in numerical order but when I try to call fillPositive from the main method I get the error at compile time 'The name 'fillPositive' does not exist in the current context'. </p>
  
  <p>Here is my code.  </p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  
  
  namespace SOFT140
  {
      class Program
      {
          static void Main(string[] args)
          {
              int[] taskOneArray = new int[15];
              taskOneArray = fillPositive(15);
              Console.WriteLine(taskOneArray);
              Console.ReadKey();
          }
  
      }
  }
  
  using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  
  namespace SOFT140
  {
      public class ArrayMethod
      {
          public static int[] fillPositive(int n)
          {
              int sum = 0;               // Variable to hold element values
              int[] a = new int[n];
  
              for (int i = 0; i &lt; a.Length; i++)       // Iterate though all array elements adding one each time
              {
                  a[i] = sum + 1;
                  sum++;
              }
  
              return a;   // Return the array
  
          }
  
      }
  }
  </code></pre>
  
  <p>I have tried initialising the array in a few different ways to see if it was the problem. But I still get the same error.</p>
  
  <pre><code>int[] taskOneArray = fillPositive(15);
  
  int[] taskOneArray = new int[fillPositive(15)];
  </code></pre>
  
  <p>Any help would be much appreciated. </p>
  
  <p>EDIT: When I invoke the method like this:</p>
  
  <pre><code>taskOneArray = ArrayMethod.fillPositive(15);
  </code></pre>
  
  <p>I get the same error message for the class. 
  'The name ArrayMethod does not exist in the current context'</p>