title: Calling a generic function without arguments
body: <p>I have a generic function <code>baz</code> that takes no arguments and want to call it from another member function <code>helper</code>. I wanted to specify the type when I called the function. I tried doing <code>baz&lt;T&gt;()</code> but this didn't compile. The only way I was able to get it to compile was this way:</p>
  
  <pre><code>class Foo&lt;T&gt; {
    public Foo&lt;?&gt; helper() {
      return baz();
    }
  
    public &lt;R&gt; Foo&lt;R&gt; baz() {
      return new Foo&lt;R&gt;();
    }
  }
  </code></pre>
  
  <p>How does this compile? What type is <code>baz</code> returning? I come from a C++ background BTW.</p>