title: Returning from input() method, in while loop within same method
body: <pre><code>namespace ClassesnObject
  {
  class Program
  {
  
      public class myClass
      {
          string val;
          public static int val2 = 0;            
  
          public void bottle(string name)
          {
              val = name;
              val2++;
          }            
  
      }
      static ConsoleKeyInfo readkey = new ConsoleKeyInfo();
      static myClass myObj = new myClass();
      static void input()    //This is the problematic method
      {
          string name;
          bool con = true;   
          Console.WriteLine("Enter name: ");
          name = Console.ReadLine();
          myObj.bottle(name);
          while (con)
          {                
              Console.WriteLine("Want to enter more name(Y/N)? ");                
              readkey = Console.ReadKey();
              if (readkey.KeyChar == 'Y' || readkey.KeyChar == 'y') input();
              else if (readkey.KeyChar == 'N' || readkey.KeyChar == 'n') return;//Problem
              else continue;
          }
      } 
      static void Main(string[] args)
      {
          input();
          Console.WriteLine("No. of entries are: " + myClass.val2);
          Console.ReadLine();                    
      }
  }
  </code></pre>
  
  <p>When I'm in input() method, and in while loop pressing 'Y' or 'y' does the work, but 'N' or 'n' doesn't.
  It seems like when pressing 'N' or 'n' it will not return until we have pressed 'N' or 'n' the times we have entered the names.</p>