fork download
  1. using System;
  2. using System.Collections;
  3.  
  4. public class Test
  5. {
  6. class Hoge {
  7. public int x = 10;
  8. }
  9.  
  10. public static void Main()
  11. {
  12. ArrayList testlist = new ArrayList();
  13. Hoge hogeinst = new Hoge();
  14. testlist.Add(hogeinst);
  15.  
  16. Hoge thisClass = (Hoge)testlist[0];
  17. int y = thisClass.x;
  18. Console.WriteLine(y);
  19. }
  20. }
Success #stdin #stdout 0.03s 33880KB
stdin
Standard input is empty
stdout
10