fork download
  1. using System;
  2.  
  3. class Ref<A>
  4. {
  5. private A value;
  6. public A Value {
  7. get { return this.value; }
  8. set { this.value = value; }
  9. }
  10. public Ref(A value) { this.value = value; }
  11. }
  12.  
  13. public class Test
  14. {
  15. private static void print<A, B>(Ref<A> a, Ref<B> b)
  16. {
  17. Console.WriteLine("a.Value = {0}, b.Value = {1}", a.Value, b.Value);
  18. }
  19.  
  20. public static void Main()
  21. {
  22. var a = new Ref<object>(null);
  23. var b = a;
  24. print(a, b);
  25. a.Value = new object();
  26. print(a, b);
  27. }
  28. }
Success #stdin #stdout 0.02s 33832KB
stdin
Standard input is empty
stdout
a.Value = , b.Value = 
a.Value = System.Object, b.Value = System.Object