title: An object reference is required for the non-static field, method, or property ConsoleApplication5.Program.myFirst(int, int)
body: <p>I am new to C# and programming at whole and today I started learning C#. I have reached in the function part of my tutorial book but I fail to grasp the error in my code. I am doing exactly what's written on the book and yet this error is popping out. Google couldn't help me much as most of the Google search results had complicated solutions which went above my head. So, I would appreciate if someone takes a few minutes and point me out what I am doing wrong in my code.</p>
  
  <p>The IDE is showing this error:</p>
  
  <blockquote>
    <p>Error 1   An object reference is required for the non-static field,
    method, or property 'ConsoleApplication5.Program.myFirst(int,
    int)' C:\Users\Eion\documents\visual studio
    2013\Projects\ConsoleApplication5\ConsoleApplication5\Program.cs  17  25  ConsoleApplication5</p>
  </blockquote>
  
  <p>And my code is:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  
  namespace ConsoleApplication5
  {
      class Program
      {
          static void Main(string[] args)
          {
              Console.Write("First: ");
              int ab = int.Parse(Console.ReadLine());
              Console.Write("Second: ");
              int ba = int.Parse(Console.ReadLine());
              int my1Res= myFirst(ab, ba);
              Console.WriteLine("The result is " + my1Res);
  
          }
          public int myFirst(int ab, int ba)
          {
              int myRes = ab + ba;
              return myRes;
          }
      }
  }
  </code></pre>