cancel
Showing results for 
Search instead for 
Did you mean: 

Java collections

Occasional Contributor

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)+" ");
}
}

1 REPLY 1
Community Hero

Re: Java collections

New Here?
Join us and watch the welcome video:
Watch the new Interview