当前位置:首页 >课程 >Java程序设计

1、下列数组定义及赋值,错误的是( )。

A.int a[]={1,2,3};
B.int a[];
C.a=new int[3]; a[1]=1; a[2]=2; a[3]=3;
D.int a[][]=new int[3][]; a[0]=new int[2]; a[1]=new int[2]; a[2]=new int[2];

参考答案:请扫码使用小程序查看答案

2、JAVA语言使用的字符集是( )。

A.ASCII
B.EBCDIC
C.Unicode
D.BCD

参考答案:请扫码使用小程序查看答案

3、下面数据类型转换中,必须进行强制类型转换的是( )。

A.byte->int;
B.int->char;
C.short->float;
D.float->double;

参考答案:请扫码使用小程序查看答案

4、以下标识符中( )是不合法的。

A._small
B.Big
C.$12ab
D.7hello

参考答案:请扫码使用小程序查看答案

5、下面赋值语句不会产生编译错误或警告的是( )。

A.char a=’abc’ ;
B.byte b=145;
C.float c=3.14;
D.int i=12;

参考答案:请扫码使用小程序查看答案