不是合法创建数组的语句是( )
A: var myarray = [ 1.1, true, “a”, ];
B: var myarray = [];
C: var myarray = {};
D: var myarray = new Array();
A: var myarray = [ 1.1, true, “a”, ];
B: var myarray = [];
C: var myarray = {};
D: var myarray = new Array();
举一反三
- 以下( )语句不能创建数组。 A: var myarray = new Array ; B: var myarray = new Array(5); C: var myarray=new Array("hello" ,"hi","greetings"); D: var myarray = new Array[10];
- 下列程序段的输出结果是: var myArray=new Array(1,3,5,7,9); for (var i=0;i<5;i+=2) document.write(myArray[i]+" ");
- 下面是几条定义初始化一维数组的语句,其中正确的是( )。 A: int myArray[] = {1,2,3,4,5}; B: int[] myArray = New int[]; C: int[] myArray = new int[] {1,2,3,4,5}; D: int[] myArray; myArray = {1,2,3,4,5};
- 下列是几条定义初始化一维数组的语句,其中正确的是。 A: int myArray[] = {1,2,3,4,5} B: int[] myArray = new int[] C: int[]myArray; myArray = {1,2,3,4,5} D: int[] myArray = new int[]{1,2,3,4,5}
- int[] myArray = new int[] {1,2,3,4,5}; 以下哪个选项可以用一个数组创建一个列表?() A: List myList = myArray.asList(); B: List myList = Arrays.asList(myArray); C: List myList = new ArrayList(myArray); D: List myList = Collections.fromArray(myArray);