title: Access variable from another method in another class
body: <p>Suppose I have a file <code>ABC.CS</code> in that file I have a class <code>ABC</code> as below and method <code>Test()</code>:</p>
  
  <pre><code>public class ABC
  {
     public static void Test()
        {
              int a=10;
              int b=11;
              int c=12;
                 //many many variables
        }
  }
  </code></pre>
  
  <p>I want to access <code>a</code>, <code>b</code> ... etc in another method of another class of another file say</p>
  
  <ul>
  <li>File : <code>XYZ.cs</code></li>
  <li>Class: <code>XYZ</code></li>
  <li>Method: <code>MyMethos()</code>.</li>
  </ul>
  
  <p><strong>Note</strong>: Variable may be any of type, like <code>int</code>, <code>float</code>, and <code>DataTable</code> etc</p>
  
  <p><strong>Updated</strong>
  Seems like people ignored <code>static</code> keyword, please give working example</p>
  
  <p>How can I do this ?</p>
  
  <p>Thanks.</p>