int ia = new int [15];
float fa = new float [20];
char ca = “Some String”;
Object oa = new float[20];
Int ia = (4, 5, 6) (1, 2, 3)
第1题:
下面______不是创建数组的正确语句。
A.float f[] f[] = new float[5][5];
B.float f[][] = new float[5][5];
C.float f[][] = new float[][5],
D.float [][] f= new float[5][];
第2题:
下列语句中,可以创建数组实例的有()。
第3题:
若有定义 class A{int x,y; static float f(int a){…} float g(int x1,int x2){…}} 及A a1=new A( );则下列用法中非法的是( )。
第4题:
Which two create an instance of an array?()
第5题:
1. public class X ( 2. public object m () { 3. object o = new float (3.14F); 4. object [] oa = new object [1]; 5. oa[0]= o; 6. o = null; 7. return oa[0]; 8. } 9. } When is the float object created in line 3, eligible for garbage collection?()
第6题:
Which two code fragments correctly create and initialize a static array of int elements?()
第7题:
int a[ ][ ] = new int[][];
int a[10][10] = new int[][];
int a[ ][ ] = new int[10][10];
int [ ][ ]a = new int[10][10];
int [ ]a[ ] = new int[10][10];
第8题:
float[] = new float(3);
float f2[] = new float[];
float[] f1 = new float[3];
float f3[] = new float[3];
float f5[] = { 1.0f, 2.0f, 2.0f };
float f4[] = new float[] { 1.0f. 2.0f. 3.0f};
第9题:
int[] a = {1,2,3,4,5}
int[] a = new int[2]
int[][] b = new int[][2]
int[][] b = new int[2][];
第10题:
int fun(int a, float b) { } float fun(int a, float b) { }
float fun(int a, float b) { } float fun(int x, float y) { }
float fun(float a) { } float fun(float a, float b) { }
float fun1(int a, float b) { } float fun2(int a, float b) { }
第11题:
int a1[]={3,4,5};
String a2[]={string1,string1,string1};
String a3[]=new String(3);
int[][] a4=new int[3][3];
第12题:
int[] ia = new int [15];
float fa = new float [20];
char*+ ca =“Some String”;
Object oa = new float[20];
Int ia [][] =(4,5,6)(1,2,3)
第13题:
public class X { public object m () { object o = new float (3.14F); object oa = new object [1]; oa[0]= o; o = null; return oa[0]; } } When is the float object created in line 3, eligible for garbage collection?()
第14题:
哪个语句创建了一个数组实例?()
第15题:
Which two code fragments correctly create and initialize a static array of int elements()
第16题:
Which two cause a compiler error?()
第17题:
1. public class X { 2. public object m () { 3. object o = new float (3.14F); 4. object [] oa = new object [1]; 5. oa[0]= o; 6. o = null; 7. oa[0] = null; 10. return o; 9. } 10. } When is the float object created in line 3, eligible for garbage collection?()
第18题:
g(3,2)
f(3)
a1.f(4)
a1.g(2,5)
第19题:
static final int[]a={100,200};
static final int[]a;static{a=new int[2];a[0]=100;a[1]=200;}
static final int[]a=new int[2]{100,200};
static final int[]a;static void int(){a=new int[3];a[0]=100;a[1]=200;}
第20题:
int[] ia= new int [15];
float fa= new float [20];
char[] ca= “Some String”;
int ia [][]= {4,5,6} {1,2,3};
第21题:
int a[]=new int[5]{1,2,3,4,5}
int[,]a=new inta[3][4]
int[][]a=new int[3][];
int[]a={1,2,3,4};
第22题:
Just after line 5
Just after line 6
Just after line 7 (that is, as the method returns)
Never in this method.
第23题:
static final int[] a = { 100,200 };
static final int[] a; static { a=new int[2]; a[0]=100; a[1]=200; }
static final int[] a = new int[2] { 100,200 };
static final int[] a; static void init() { a = new int[3]; a[0]=100; a[1]=200; }