title: Can C# style object initialization be used in Java?
body: <p>In C# it's possible to write:</p>
  
  <pre><code>MyClass obj = new MyClass()
  {
      field1 = "hello",
      field2 = "world",
      field3 = new MyOtherClass()
      {
          etc....
      }
  }
  </code></pre>
  
  <p>I can see that array initialization can be done in a similar way but can something similar to the above be done in Java too, and if so, what's the syntax?</p>