fork download
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. public class Stuff{
  5. public List<int> list {get; set;}
  6. public Stuff(){
  7. list = new List<int> {1, 2, 3};
  8. }
  9. }
  10.  
  11. public class Test
  12. {
  13. public static void Main()
  14. {
  15. var stuff = new Stuff { list = {4, 5, 6} };
  16. foreach(var i in stuff.list)
  17. Console.WriteLine(i);
  18. }
  19. }
Success #stdin #stdout 0.03s 33760KB
stdin
Standard input is empty
stdout
1
2
3
4
5
6