title: Java function definition with brackets syntax
body: <p>Was looking in the source for <code>ByteArrayOutputStream</code>, and I saw this function:</p>
  
  <pre><code>public synchronized byte toByteArray()[] {
      return Arrays.copyOf(buf, count);
  }
  </code></pre>
  
  <p>Where is this syntax documented? I mean the <code>[]</code> in front of the function. Is this the same as in declaring a regular array where the bracket can go after the name of the array or before, but in this case, the bracket can go after the function name?</p>
  
  <pre><code>String[] args;
  </code></pre>
  
  <p>Vs</p>
  
  <pre><code>String args[];
  </code></pre>
  
  <hr>
  
  <p><strong>Edit: 2018-05-22</strong></p>
  
  <p>I found even more uses of this crazy syntax here: <a href="https://blog.jooq.org/2014/11/03/10-things-you-didnt-know-about-java/" rel="nofollow noreferrer">10 things you didn't know about Java</a></p>
  
  <p>#3 is where they make mention of all the ways the above syntax can be exploited</p>