title: Why doesn't Java have initializer lists like in C++?
body: <p>In C++, you can use an initializer list to initialize the class's fields before the constructor begins running.  For example:</p>
  
  <pre><code>Foo::Foo(string s, double d, int n) : name(s), weight(d), age(n) {
      // Empty; already handled!
  }
  </code></pre>
  
  <p>I am curious why Java does not have a similar feature.  According to <em>Core Java: Volume 1</em>:</p>
  
  <blockquote>
    <p>C++ uses this special syntax to call field constructors. In Java, there is no need for it because objects have no subobjects, only pointers to other objects.</p>
  </blockquote>
  
  <p>Here are my questions:</p>
  
  <ol>
  <li><p>What do they mean by "because objects have no subobjects?" I don't understand what a subobject is (I tried looking it up); do they mean an instantiation of a subclass which extends a superclass?</p></li>
  <li><p>As for why Java does not have initializer lists like C++, I would assume that the reason is because all fields are already initialized by default in Java and also because Java uses the <code>super</code> keyword to call the super(or base in C++ lingo)-class constructor.  Is this correct?</p></li>
  </ol>