title: java inheritance
body: <p>When I change this code into <code>Member m1 =  new Member ();</code> It works perfectly. Why it does not work for Super class reference? Please  can someone explain?</p>
  
  <pre><code>public class Family {
  
  String Surname = "Richard";
  String Address = "No:10, High Street,Colombo";
  
  }
  
  public class Member extends Family{
  
  String Name;
  int age;
  
  public void Details() {
      System.out.println("full Name ="+ Name +" "+ Surname);
      System.out.println("Age =" +age);
      System.out.println("Address =" + Address);
  }
  
  public static void main(String[] args) {
      Member m1 =  new Family ();
  
      m1.Name="Anne";
      m1.age=24;
  
      m1.Details();
  
  }
  </code></pre>