In BlueJ, if I write a method that takes an array as a parameter, then when I want to test this method when the method is called, I need to enter elements with curly braces, so:
{1,2,3}
How to make a method call for ArrayList?
Here is my code:
import java.util.*;
public class Test2{
public static int[] toArray(ArrayList<Integer>a){
int len = a.size();
int []b = new int[len];
for(int i = 0; i<len; i++){
b[i] = a.get(i);
}
return b;
}
}
Now I want to test it in BlueJ, what should I enter in the next dialog box?

source
share