title: initialize object directly in java
body: <p>Is that possible to initialize object directly as we can do with String class in java:</p>
  
  <p>such as: </p>
  
  <pre><code>String str="something...";
  </code></pre>
  
  <p>I want to do same for my custom class: </p>
  
  <pre><code>class MyData{
  public String name;
  public int age;
  }
  </code></pre>
  
  <p>is that possible like </p>
  
  <pre><code>MyClass obj1={"name",24};
  </code></pre>
  
  <p>or </p>
  
  <pre><code>MyClass obj1="name",24;
  </code></pre>
  
  <p>to initialize object?
  or how it can be possible!</p>