title: Can "ref" be used as a persistent link between classes?
body: <p>I have one instance of ClassA that is passed as a ref to constructor of ClassB. Does the instance of ClassB now always have the access to the newest updated version of the passed instance of ClassA?</p>
  
  <pre><code>public class ClassA {
      private int variableA = 0;
      public ClassA() { }
      public void Change(int newValue) {
          variableA = newValue;
      }
  }
  
  public class ClassB {
      public ClassA classA;
      public ClassB(ref ClassA refClassA) {
          classA = refClassA;
      }
      public void Print() {
          Console.WriteLine(classA.variableA);
      }
  }
  
  static void Main() {
      ClassA classA = new ClassA();
      ClassB classB = new ClassB(ref classA);
      classB.Print(); // 0
      classA.Change(50);
      classB.Print(); // 50?
  }
  </code></pre>
  
  <p>I've read what I found on the internet but the only usage I've found was to update the referenced value, like in dotnetperls <a href="http://www.dotnetperls.com/ref" rel="nofollow">http://www.dotnetperls.com/ref</a> . </p>