Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections.Generic;
- public class Program
- {
- public static void Main()
- {
- int outparam;
- Outer.CreateInstance(5);
- outparam = _kList[3];
- }
- }
- public static class Outer
- {
- public static void CreateInstance(int a)
- {
- List<Nested> _kList = new List<Nested>();
- for (int i = 1; i < 10; i++)
- {
- Nested _k = new Nested(a);
- _kList.Add(_k);
- }
- }
- private class Nested
- {
- int a;
- public Nested(int a)
- {
- this.a = a;
- }
- }
- }
Add Comment
Please, Sign In to add comment