title: Passing superclass object as parameter to subclass constructor (java)
body: <p>I've done a bit of searching, but I'm either not asking the right question or not remembering correctly.  In any case, in Java, I am wondering if it is possible to pass the super class object in as a parameter to a subclass and what the most efficient way of making that object's data available to the class's super class.</p>
  
  <p>Code examples:</p>
  
  <pre><code>public class superclass {
    String myparm1;
    String myParm2;
    int myParmN;
  
    public superclass(String p1, String p2, int pn)
    {
      this.myparm1 = p1;
      this.myparm2 = p2;
      this.myParmN = pn;
    }
    // other methods here
  }
  
  public class subclass extends superclass {
    double b1;
    double b2;
  
    public subclass(superclass sc, double b1, double b2) {
      // easy way to make sc data available to this class?
      // Do I create a copy or clone method, or some other way?
      // calling super(sc); wouldn't exactly work 
      this.b1 = b1;
      this.b2 = b2;
    }
  }
  </code></pre>
  
  <p>if I had a constructor in superclass that was <code>public superclass(superclass sc) { // assign sc properties to this properties, correct? }</code> then I could simply use <code>super(sc);</code></p>