Forum Discussion

vijaysimha's avatar
vijaysimha
Occasional Contributor
6 years ago

Java collections

Hello All,

Please guide us on how to use Java library in TestComplete.I have to write a script for ArrayList in js file is it possible?Or else how to write it.

 

public static void main(String[] args)
throws IOException
{
int n = 5;

//declaring ArrayList with initial size n
ArrayList<Integer> arrli = new ArrayList<Integer>(n);

// Appending the new element at the end of the list
for (int i=1; i<=n; i++)
arrli.add(i);
System.out.println(arrli);
arrli.remove(3);
System.out.println(arrli);
for (int i=0; i<arrli.size(); i++)
System.out.print(arrli.get(i)+" ");
}
}