title: array of pair, ArrayList in java
body: <p>how can I make array of ArrayList or Pair Class which I made myself at the code below.</p>
  
  <p>ex1)</p>
  
  <pre><code>import java.util.*;
  
  class Pair{
    static int first;
    static int second;
  }
  
  public class Main{
    public static void main(String[] args){
      Vector&lt;Pair&gt;[] v = new Vector&lt;Pair&gt;[100](); //this gives me an error
    }
  }
  </code></pre>
  
  <p>1.why the code above gives me an error?
  2.my goal is to make an array of vector so that each index of vector holds one or more Pair classes. How can I make it? </p>
  
  <p>another example) : array of ArrayList</p>
  
  <pre><code>import java.util.*;
  
  public class Main{
    public static void main(String[] args){
      ArrayList&lt;Integer&gt; arr = ArrayList&lt;Integer&gt;(); //I know this line doesn't give error
      ArrayList&lt;Integer&gt;[] arr = ArrayList&lt;integer&gt;[500]; // this gives me an error
    }
  }
  </code></pre>
  
  <p>3.why does the code above give me an error?
  4.my goal is to make an array of ArrayList so that each index of Array has ArrayList/Queue/Vector/Deque whatever. How can I make it? </p>