Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- public class Program
- {
- public static void Main()
- {
- Outer.CreateInstance(34);
- Outer.CreateInstance(5);
- Outer.CreateInstance(21);
- Console.WriteLine(Outer.CompareRecord(0,34));
- }
- }
- public static class Outer
- {
- private static List<Nested> ListOfNested = new List<Nested>();
- public static void CreateInstance(int input)
- {
- Nested record = new Nested(input);
- ListOfNested.Add(record);
- }
- public static bool CompareRecord(int location, int num)
- {
- // return (ListOfNested[location].Field == num);
- return (ListOfNested[location].field == num);
- }
- private class Nested
- {
- int field;
- public Nested(int field)
- {
- this.field = field;
- }
- public int Field
- {
- get {return field;}
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment