title: Why can we reduce visibility of a property in extended class?
body: <p>I have two classes, <code>Parent</code>:</p>
  
  <pre><code>public class Parent {
      public String a = "asd";
  
      public void method() {
  
      }
  }
  </code></pre>
  
  <p>And <code>Child</code>:</p>
  
  <pre><code>public class Child extends Parent{
      private String a = "12";
  
      private void method() {
  
      }
  }
  </code></pre>
  
  <p>In <code>Child</code>, I try to override the parent <code>method</code> which gives a compile time error of <code>cannot reduce visibility of a method</code> which is fine.</p>
  
  <p>But, why is this error not applicable to property <code>a</code>? I am also reducing visibility of <code>a</code>, but it doesn't give an error.</p>