title: inherited variable of class2 is different from class1 (C#)
body: <p>I just made a class Shapes and an other 2 classes ('Triangle' &amp; 'Square') which inherit from 'Shapes'. </p>
  
  <pre><code>public class Shapes
  {
      private int sides;
  }
  
  public class Triangle : Shapes
  {
      public void init()
      {
          int sides = 3;
          throw new System.NotImplementedException();
      }
  }
  
  public class Square : Shapes
  {
      public void init()
      {
          int sides = 4;
          throw new System.NotImplementedException();
      }
  }
  </code></pre>
  
  <p><em>Code is designed using Classdiagram</em></p>
  
  <p>Question: How should I call the class so that it shows how many sides does a shape has?</p>
  
  <p>Thanks</p>