Is there something comparable to the "result"-variable in Delphi also in Java?
<p>One of the things I really liked while working with Delphi was that there was a <code>result</code> variable for functions. A Delphi function ended like this:</p>

<pre><code>result:="My Result";
</code></pre>

<p>The datatype of the result variable is the return type of the function. No additional code was necessary. Nowadays, when i'm writing stuff in Java, it looks most of the time like this:</p>

<pre><code>function List&lt;Foo&gt; myFunc(){
  List&lt;Foo&gt; myResultVar = new ArrayList&lt;&gt;();
  //--now i do some clever stuff--
  return myResultVar;
}
</code></pre>

<p>As you see, it's some more boilerplate code compared to Delphi at least when you have to write more than a one-liner. Is there something comparable to the <code>result</code> variable in Java and i just don't know it?</p>
