title: Call subclass constructor from parent in Java
body: <p>so I'm learning about java inheritance and I just ran into a situation I don't know how to solve.  </p>
  
  <p>What I'm trying to do is to call a subclass constructor from the superclass. I don't know if this makes any sense, but I'll try to explain myself with an example.  </p>
  
  <pre><code>public class Phone {
      private String brand;
      private int weight;
  
      public Phone(String brand, int weight) {
          this.brand = brand;
          this.weight = weight;
      }
  
      public Phone(String brand, int weight, String tech) {
          // Here it is where I'm stuck
          // Call SmartPhone constructor with all the parameters
      }
  }
  </code></pre>
  
  <p>&#160;</p>
  
  <pre><code>public class SmartPhone extends Phone {
      private String tech;
  
      public SmartPhone(String Brand, int weight, String tech) {
          super(brand, weight);
          this.tech = tech;
      }
  }
  </code></pre>
  
  <p>Why would I want to do that?  </p>
  
  <p>I would like to be able to not have to deal with SmartPhone in the main.<br>
  I'd like to be able to do:  </p>
  
  <pre><code>Phone nokia = new Phone("Nokia", 295); // &lt;- Regular Phone Instance
  Phone iphone = new Phone("iPhone", 368, "4G"); // &lt;- SmartPhone instance
  </code></pre>