title: Java Call a Constructor from Another Constructor Without Immediately Having the Parameters
body: <p>Is there is any way to call a constructor from another constructor without immediately having the parameters for it?</p>
  
  <p>I ran into this problem while trying to create a constructor for my <code>SimpleDate</code> class that took in a millis time parameter and used another constructor to create the class (code below). The problem that I ran into was that the constructor call has to be on the first line but I don't really see anyway to get a <code>Calendar</code> instance with the right time without first setting the time in milliseconds on a previous line. I don't see how do that on one line, because <code>setTimeInMillis</code> is a void method and I don't think it possible to return the value after invoking a method (if it is than i would very much like to know how as well). I realize this whole thing is not really completely necessary but i do want to know if it is possible and if it is, how I would do it.</p>
  
  <pre><code>        public SimpleDate(long timeMillis) {
              this(Calendar.getInstance().setTimeInMillis(timeMillis));//Obviously this doesn't work because setTimeInMillis is a void method
          }
  
          public SimpleDate(Calendar calendar) {
              this.year = calendar.get(Calendar.YEAR);
              this.month = calendar.get(Calendar.MONTH) + 1;
              this.day = calendar.get(Calendar.DAY_OF_MONTH);
  
              this.hour = calendar.get(Calendar.HOUR_OF_DAY);
              this.minute = calendar.get(Calendar.MINUTE);
              this.second = calendar.get(Calendar.SECOND);
          }
  </code></pre>