How to enter parameters for ArrayList in BlueJ?

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?

enter image description here

+5
source share
2 answers

ArrayList . BlueJ, "", " ...", java.util.ArrayList "". , "".

BlueJ Call Library Class dialog

BlueJ ArrayList. Integer .

BlueJ Create Object dialog

"" ArrayList BlueJ.

BlueJ Object Bench

BlueJ , . boolean add(Integer), .

Add Integers to the ArrayList

, toArray, ArrayList, .

BlueJ Method Call dialog

.

BlueJ Method Results dialog

"", int, , "", .

+2
Arrays.asList("1", "2", "3");

a List, a ArrayList.

, .

0