title: Create new instance of T in Java
body: <p>in C#, we can define a generic <code>class A&lt;T&gt; where T : new()</code>. In this code, we can create an instance of <code>T</code> with <code>new T()</code>. How does this implement in Java? I read some article which says it's impossible.</p>
  
  <p>The reason that I used have a singleton patten using generic in C# like:</p>
  
  <pre><code>public static class Singleton&lt;T&gt; where T : new()
  {
      private static T instance;
  
      public static T Instance
      {
          get 
          {
              if (instance == null)
              {
                  instance = SingletonCreater.Instance;
              }
              return instance;
          }
      }
  
      static class SingletonCreater
      {
          internal static readonly T Instance = new T();
      }
  }
  </code></pre>
  
  <p>And way to make this method more graceful?</p>