Guest User

Untitled

a guest
Jan 8th, 2017
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.51 KB | None | 0 0
  1. using System.Collections.Generic;
  2.  
  3. public class Program
  4. {
  5.     public static void Main()
  6.     {
  7.         int outparam;
  8.         Outer.CreateInstance(5);
  9.         outparam = _kList[3];
  10.     }
  11. }
  12.  
  13. public static class Outer
  14. {
  15.     public static void CreateInstance(int a)
  16.     {
  17.         List<Nested> _kList = new List<Nested>();
  18.        
  19.         for (int i = 1; i < 10; i++)
  20.         {
  21.             Nested _k = new Nested(a);
  22.             _kList.Add(_k);
  23.         }
  24.     }
  25.        
  26.     private class Nested
  27.     {
  28.         int a;
  29.         public Nested(int a)
  30.         {
  31.             this.a = a;
  32.         }
  33.     }
  34. }
Add Comment
Please, Sign In to add comment