创建数组正确的是:
A: int[] ia = new int [15];
B: float fa = new float [20];
C: char[] ca = “Some String”;
D: Object oa = new float[20];
E: Int ia [][] = (4, 5, 6) (1, 2, 3)
A: int[] ia = new int [15];
B: float fa = new float [20];
C: char[] ca = “Some String”;
D: Object oa = new float[20];
E: Int ia [][] = (4, 5, 6) (1, 2, 3)
举一反三
- Which two create an instance of an array?() A: int ia = new int [15]; B: float fa = new float [20]; C: char ca = “Some String”; D: Object oa = new float[20]; E: Int ia = (4, 5, 6) (1, 2, 3)
- 下列关于数组声明、初始话的语句,错误的是: A: int x[];x=new int[4]; B: int x[2]={1,2}; C: float y[][]=new float[2][3]; D: float[][] y=new float[2][];y[0]=new float[3];y[1]=new float[2];
- 下列数组定义正确的是( )。 A: int[] a[]= new float[2]; B: byte b[][]=new byte[3][]; C: String[] str=new String[3]; D: int my[][]=new int[3][3];
- 下面创建数组的语句( )是正确的。 A: int a[5] = {1,2,3,4,5}; B: float f[10] = new float; C: char ch[] = "abcd"; D: int n = 10; int[] a = new int[n];
- 关于二维数组的创建,以下做法正确的是: (1)int a[][] =new int[4][5] (2)int a[][] =new int[4][]; a[0]=new int[10];a[1]=new int[20]; (3)int a[][]; a=new int[3][]; a[0]=new int[3]; a[1]={1,2};a[2]={1,2,3};