多选题Which two create an instance of an array?()Aint ia = new int [15];Bfloat fa = new float [20];Cchar ca = “Some String”;DObject oa = new float[20];EInt 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)


相似考题
参考答案和解析
正确答案: B,E
解析: 暂无解析
更多“多选题Which two create an instance of an array?()Aint ia = new int [15];Bfloat fa = new float [20];Cchar ca = “Some String”;DObject oa = new float[20];EInt 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][];


    正确答案:C

  • 第2题:

    下列语句中,可以创建数组实例的有()。

    • 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,D

  • 第3题:

    若有定义 class A{int x,y; static float f(int a){…} float g(int x1,int x2){…}} 及A a1=new A( );则下列用法中非法的是( )。

    • A、g(3,2)
    • B、f(3)
    • C、a1.f(4)
    • D、a1.g(2,5)

    正确答案:C

  • 第4题:

    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,D

  • 第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?()  

    • A、 Just after line 5
    • B、 Just after line 6
    • C、 Just after line 7 (that is, as the method returns)
    • D、 Never in this method.

    正确答案:D

  • 第6题:

    Which two code fragments correctly create and initialize a static array of int elements?()

    • A、static final int[] a = { 100,200 };
    • B、static final int[] a; static { a=new int[2]; a[0]=100; a[1]=200; }
    • C、static final int[] a = new int[2]{ 100,200 };
    • D、static final int[] a; static void init() { a = new int[3]; a[0]=100; a[1]=200; }

    正确答案:A,B

  • 第7题:

    多选题
    下面哪个语句正确地声明一个整型的二维数组?()
    A

    int a[ ][ ] = new int[][];    

    B

    int a[10][10] = new int[][];    

    C

    int a[ ][ ] = new int[10][10];    

    D

    int [ ][ ]a = new int[10][10];    

    E

    int [ ]a[ ] = new int[10][10];


    正确答案: C,D
    解析: 暂无解析

  • 第8题:

    多选题
    Which two cause a compiler error?()
    A

    float[] = new float(3);

    B

    float f2[] = new float[];

    C

    float[] f1 = new float[3];

    D

    float f3[] = new float[3];

    E

    float f5[] = { 1.0f, 2.0f, 2.0f };

    F

    float f4[] = new float[] { 1.0f. 2.0f. 3.0f};


    正确答案: D,C
    解析: The F. statement is incorrect. The float numbers should be separated with commas and not dots.

  • 第9题:

    单选题
    以上哪种创建数组不正确()
    A

    int[] a = {1,2,3,4,5}

    B

    int[] a = new int[2]

    C

    int[][] b = new int[][2]

    D

    int[][] b = new int[2][];


    正确答案: B
    解析: 暂无解析

  • 第10题:

    单选题
    下面的方法重载,正确的是()。
    A

    int fun(int a, float b) { }  float fun(int a, float b) { }

    B

    float fun(int a, float b) { } float fun(int x, float y) { }

    C

    float fun(float a) { }  float fun(float a, float b) { }

    D

    float fun1(int a, float b) { }  float fun2(int a, float b) { }


    正确答案: A
    解析: 暂无解析

  • 第11题:

    单选题
    下面关于数组声明和初始化的语句哪个有语法错误()
    A

    int a1[]={3,4,5};

    B

    String a2[]={string1,string1,string1};

    C

    String a3[]=new String(3);

    D

    int[][] a4=new int[3][3];


    正确答案: D
    解析: 暂无解析

  • 第12题:

    多选题
    下列语句中,可以创建数组实例的有()。
    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)


    正确答案: E,C
    解析: 暂无解析

  • 第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?()

    • A、 Just after line 5
    • B、 Just after line 6
    • C、 Just after line 7 (that is, as the method returns)
    • D、 Never in this method.

    正确答案:D

  • 第14题:

    哪个语句创建了一个数组实例?()

    • A、int[] ia= new int [15];
    • B、float fa= new float [20];
    • C、char[] ca= “Some String”;
    • D、int ia [][]= {4,5,6} {1,2,3};

    正确答案:A

  • 第15题:

    Which two code fragments correctly create and initialize a static array of int elements()

    • A、static final int[]a={100,200};
    • B、static final int[]a;static{a=new int[2];a[0]=100;a[1]=200;}
    • C、static final int[]a=new int[2]{100,200};
    • D、static final int[]a;static void int(){a=new int[3];a[0]=100;a[1]=200;}

    正确答案:A,B

  • 第16题:

    Which two cause a compiler error?() 

    • A、 float[] = new float(3);
    • B、 float f2[] = new float[];
    • C、 float[] f1 = new float[3];
    • D、 float f3[] = new float[3];
    • E、 float f5[] = { 1.0f, 2.0f, 2.0f };
    • F、 float f4[] = new float[] { 1.0f. 2.0f. 3.0f};

    正确答案:A,B

  • 第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?()  

    • A、 Just after line 5.
    • B、 Just after line 6.
    • C、 Just after line 7.
    • D、 Just after line 8(that is, as the method returns).

    正确答案:C

  • 第18题:

    单选题
    若有定义 class A{int x,y; static float f(int a){…} float g(int x1,int x2){…}} 及A a1=new A( );则下列用法中非法的是( )。
    A

    g(3,2)

    B

    f(3)

    C

    a1.f(4)

    D

    a1.g(2,5)


    正确答案: C
    解析: 暂无解析

  • 第19题:

    多选题
    Which two code fragments correctly create and initialize a static array of int elements()
    A

    static final int[]a={100,200};

    B

    static final int[]a;static{a=new int[2];a[0]=100;a[1]=200;}

    C

    static final int[]a=new int[2]{100,200};

    D

    static final int[]a;static void int(){a=new int[3];a[0]=100;a[1]=200;}


    正确答案: C,A
    解析: 暂无解析

  • 第20题:

    单选题
    哪个语句创建了一个数组实例?()
    A

    int[] ia= new int [15];

    B

    float fa= new float [20];

    C

    char[] ca= “Some String”;

    D

    int ia [][]= {4,5,6} {1,2,3};


    正确答案: B
    解析: 暂无解析

  • 第21题:

    单选题
    下列的数组定义语句,不正确的是()。
    A

    int a[]=new int[5]{1,2,3,4,5}

    B

    int[,]a=new inta[3][4]

    C

    int[][]a=new int[3][];

    D

    int[]a={1,2,3,4};


    正确答案: D
    解析: 暂无解析

  • 第22题:

    单选题
    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?()
    A

     Just after line 5

    B

     Just after line 6

    C

     Just after line 7 (that is, as the method returns)

    D

     Never in this method.


    正确答案: A
    解析: 暂无解析

  • 第23题:

    多选题
    Which two code fragments correctly create and initialize a static array of int elements?()
    A

    static final int[] a = { 100,200 };

    B

    static final int[] a; static { a=new int[2]; a[0]=100; a[1]=200; }

    C

    static final int[] a = new int[2] { 100,200 };

    D

    static final int[] a; static void init() { a = new int[3]; a[0]=100; a[1]=200; }


    正确答案: A,D
    解析: 暂无解析