title: What is the default behavior of the diamond operator
body: <p>I remember seeing a declaration something like the following:</p>
  
  <p><code>private static Logger log = Logger.getLogger(&lt;&gt;.class);</code></p>
  
  <p>The advantage was that it could be pasted from class to class without accidentally being a logger for another class.</p>
  
  <p>Now, I can't get that to compile, the syntax must be wrong. So what exactly does &lt;> resolve to on its own (not ArrayList&lt;>(), etc.)?</p>
  
  <p>Thank you</p>
  
  <p>Update:</p>
  
  <p>My assertion that it is legal syntax comes from:</p>
  
  <ol>
  <li>I saw it out on the web as a legal and nifty trick.</li>
  <li>Both I and a colleague pasted it into IntelliJ with Java 7 and it compiled correctly.</li>
  </ol>
  
  <p>That said, I can't find a search that will get me to that page again, and I can't get it to compile now! So I'm hoping someone with compiler or Java spec knowledge can definitively say if it is valid and what the default is.</p>