Local Method In Loop - CSharp Custom Type

CSharp examples for Custom Type:Local Method

Description

Local Method In Loop

Demo Code

using System;/*from w  w  w.j a  v  a 2  s  .com*/
class LocalMethodInLoop
{
   static void Main()
   {
      for (int i = 0; i < 10; i++)
      {
         PrintI();
         void PrintI()
         {
            Console.WriteLine(i);
         }
      }
   }
}

Result


Related Tutorials