title: How to fix "type annotations are illegal here" while passing int array argument?
body: <p>I created a method which takes integer array as parameter. However I'm getting an error "Type annotations are illegal here" while passing the argument into the form <code>{int1, int2, int3}</code>.</p>
  
  <p>I tried creating an integer array first, assigning it a value and then passing the array and it worked just fine. The parameter variable is getting created when the method is being called and hence it should accept the <code>{int1, int2, int3}</code> array method of passing argument. I've searched about "Type annotations are illegal here" error, but couldn't find any relevant information.</p>
  
  <hr>
  
  <pre class="lang-java prettyprint-override"><code>public class Game {
  
      public static void main(String[] args) {
          int noOfGuesses;
          String result = "";
          int startLoc = 1;
  
          Battlefield dot = new Battlefield();
  
          dot.setLocation({startLoc,startLoc+1,startLoc+2});
  </code></pre>
  
  <p>I got an error pointing at <code>dot.setLocation(...)</code> method call.</p>
  
  <pre class="lang-java prettyprint-override"><code>public class Battlefield {
      int noHits=0;
      int position[];
  
      void setLocation(int startPosition[])
      {
          this.position= startPosition;
      }
  </code></pre>
  
  <p>The code above is <code>setLocation()</code> definition.</p>