title: equivalent of vector<T> in Java
body: <p>I'm using Java programming language.</p>
  
  <p>C++ has <code>vector&lt;T&gt;</code> and I need the equivalent vector in Java.</p>
  
  <p>I want to convert this code to Java.</p>
  
  <pre><code>Vector&lt;T&gt; a[Maxn]; // Example: string, int, myclass, myvar, ...
  int n;
  cin &gt;&gt; n;
  for(int i=0; i&lt;n; i++)
  {
      T x, y;
      cin &gt;&gt; x &gt;&gt; y;
      x--, y--;
      v[x].push_back(y);
  }
  </code></pre>