Given:int[]myArray=newint[]{1,2,3,4,5};Whatallowsyoutocreatealistfromthisarray?() A.ListmyList=myArray.asList();B.ListmyList=Arrays.asList(myArray);C.ListmyList=newArrayList(myArray);D.ListmyList=Collections.fromArray(myArray);

Given:int[]myArray=newint[]{1,2,3,4,5};Whatallowsyoutocreatealistfromthisarray?()

A.ListmyList=myArray.asList();

B.ListmyList=Arrays.asList(myArray);

C.ListmyList=newArrayList(myArray);

D.ListmyList=Collections.fromArray(myArray);


相关考题:

下列数组的初始化正确的是_________。 A.int[]score=newint[5]{1,2,3,4,5};B.int[5]score=newint[]{1,2,3,4,5};C.intscore={1,2,3,4,5};D.int[]score=newint[5];

int[][] myarray3=new int[3][]{new int[3]{5,6,2},new int[5]{6,9,7,8,3},newint[2]{3,2}};myarray3[2][2]的值是( )。

以下( )代码,能够对数组正确初始化(或者是默认初始化)。A、int[]a;B、a={1,2,3,4,5};C、int[]a=newint[5]{1,2,3,4,5};D、int[]a=newint[5];

4、下面声明和创建数组的语句错误的是()A.int[] a=new int[12];B.int[] c; c=new int[12];C.int[] n={1,2,3,4,5};D.int[] array = new int[3] {1,2};

下面声明和创建数组的语句错误的是A.int[] a=new int[12];B.int[] c; c=new int[12];C.int[] n={1,2,3,4,5};D.int[] array = new int[3] {1,2};

下列关于数组的静态初始化语句,正确的是()A.int [] score =new int[]{1,2,3,4,5};B.int [] score=new int[5]{1,2,3,4,5};C.int [5] score=new int[]{1,2,3,4,5};D.int [5] score=new int[5]{1,2,3,4,5};

8、下面声明和创建数组的语句错误的是A.int[] a=new int[12];B.int[] c; c=new int[12];C.int[] n={1,2,3,4,5};D.int[] array = new int[3] {1,2};

以下()代码,不能够对数组正确初始化(或者是默认初始化)。A.int[] a;B.int[] a = new int[5];C.int[] a = new int[5]{1, 2, 3, 4, 5};D.int[] a = {1, 2, 3, 4, 5};

以下()代码,能够对数组正确初始化(或者是默认初始化)。A.int[] a;B.a = {1, 2, 3, 4, 5};C.int[] a = new int[5]{1, 2, 3, 4, 5};D.int[] a = new int[5];