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