title: Java extends example
body: <p>i have a java beginner question:
  Parent.print() prints "hallo" in the console,
  but also Child.print() prints "hallo".
  I thought it has to print "child".
  How can i solve this?</p>
  
  <pre><code>public class Parent {
  
      private String output = "hallo";
  
      public void print() {
          System.out.println(output);
      }
  
  }
  
  public class Child extends Parent {
  
     private String output = "child";
  
  }
  </code></pre>