title: Infer variable type in Java / Eclipse, like C#'s "var"
body: <p>I like "var" from C# and "def" from Groovy, and I find writing out types in Java to be a pain.</p>
  
  <p>Say I'm writing code like:</p>
  
  <pre><code>List&lt;LongTypeName&gt; results = new ArrayList&lt;LongTypeName&gt;();
  </code></pre>
  
  <p>or</p>
  
  <pre><code>Map&lt;TypeNameOne,TypeNameTwo&gt; someLookup = fetchMeMyLookup();
  </code></pre>
  
  <p>What's the easiest way to get this done in Java + Eclipse?</p>
  
  <p>I'm especially interested in the case where I'm not 100% sure what the type will be when I start the line.</p>
  
  <p>My current strategy is to always declare variables as "int", then go back to the start of the line and do "ctrl-1", and accept the type that Eclipse has inferred. Is there any better alternative?</p>
  
  <p>What I would love is to be able to type "def" or "var" and have Eclipse auto-correct this to the correct type as soon as it can figure it out.</p>
  
  <p>(Maybe I should just be programming in Groovy)</p>