1、[多选题] 以下哪些是Java语言的特点( )摘要:1、[多选题] 以下哪些是Java语言的特点( )A、面向对象B、安全可靠C、平台无关D、多支持线程E、支持分布操作 2、[单选题] 下列语句序列执行后,i的值是( )。int i=16; do { i/=2; } while( i > 3 );A、16B、8C、4D、2&...
A、面向对象
B、安全可靠
C、平台无关
D、多支持线程
E、支持分布操作
2、[单选题] 下列语句序列执行后,i的值是( )。int i=16; do { i/=2; } while( i > 3 );A、16
B、8
C、4
D、2
3、[判断题] 用“ ”可以实现字符串的拼接,用- 可以从一个字符串中去除一个字符子串( )A、错误
B、正确
4、[判断题] 在异常处理中总是将可能产生异常的语句放在try块中,用catch子句去处理异常,而且一个try块之后只能对应一个catch语句( )。A、错误
B、正确
5、[单选题] 下列程序段执行后的结果是( )。 String s=new String("abcdefg"); for(int i=0;i<s.length();i =2){ System.out.print(s.charAt(i)); }A、aceg
B、ACEG
C、abcdefg
D、abcd
6、[单选题] 下列程序段执行后 b3 的结果是( )boolean b1=true, b2, b3; b3= b1 ?b1 : b2;A、0
B、1
C、true
D、false
7、[判断题] 如果p是父类Parent的对象,而c是子类Child的对象,则语句c = p是正确的( )A、错误
B、正确
8、[单选题] 若已定义 byte[ ] x= {11,22,33,-66} ; 其中0A、x[5-3]
B、x[k]
C、x[k 5]
D、x[0]
9、[单选题] 下面的表达式哪个是正确的( )A、String s="你好";int i=3; s =i;
B、String s="你好";int i=3; if(i==s){ s =i};
C、String s="你好";int i=3; s=i s;
D、String s="你好";int i=3; s=i ;
10、[单选题] 类Teacher和Student是类Person的子类; Person p; Teacher t; Student s; //p, t and s are all non-null. if(t instanceof Person) { s = (Student)t; } 最后一句语句的结果是( )。A、将构造一个Student对象;
B、表达式是合法的;
C、表达式是错误的;
D、编译时正确,但运行时错误。
11、[单选题] 下面语句执行后,i 的值是( )。for( int i=0, j=1; j < 5; j =3 ) i=i j;A、4
B、5
C、6
D、7
12、[单选题] 下列方法中可以用来创建一个新线程的是( )。A、实现java.lang.Runnable 接口并重写 start()方法
B、实现java.lang.Runnable 接口并重写 run()方法
C、继承java.lang.Thread 类并重写 run()方法
D、实现java.lang.Thread 类并实现 start()方法
13、[单选题] 下列关于修饰符混用的说法,错误的是( )A、abstract不能与final并列修饰同一个类
B、abstract类中不可以有private的成员
C、static方法中能处理非static的属性
D、abstract方法必须在abstract类中
14、[单选题] 下列语句序列执行后,k 的值是( )。 int i=10, j=18, k=30; switch( j - i ) { case 8 : k ; case 9 : k =2; case 10: k =3; default : k/=j; }A、31
B、32
C、2
D、33
15、[多选题] 下列哪些语句是正确的( )。A、int a[][]=new int[][3];
B、int a[][]={{1,3},{2,3,4},{1,2}};
C、String s[][]=new String[2][];
D、String s[][]={{"can","I"},{"help","you"}}
16、[判断题] 当启动 Applet 程序时,首先调用的方法是start()( )A、错误
B、正确
17、[单选题] 下列代码中,将引起一个编译错误的行是( ) 1)public class Test{ 2) int m,n; 3) public Test(){} 4) public Test(int a){m=a;} 5) public static void main(String args[]){ 6) Test t1,t2; 7) int j,k; 8) j=0;k=0; 9) t1=new Test(); 10) t2=new Test(j,k); 11) } 12) }A、第3行
B、第5行
C、第6行
D、第10行
18、[多选题] 以下哪些是Java语言的特点?( )A、结构简单,代码长度短
B、可以在网络的任何地方运行
C、使Internet上的信息真正具有动态性和交互性
D、所有Java applet都受Applet类的子类
19、[单选题] 用于定义类成员的访问控制权的一组关键字是( )A、class, float, double, public
B、float, boolean, int, long
C、char, extends, float, double
D、public, private, protected
20、[单选题] 设有定义 int i=123; long j=456; 下面赋值不正确的语句是( )A、j=i;
B、j=(long)i;
C、i=(int)j;
D、i=j;
21、[单选题] String s="This is the ";String t=s.concat("String."); t的内容是( )A、This is the String
B、This is the
C、String
22、[多选题] 关于awt和swing说法正确的是( )A、awt在不同操作系统中显示相同的风格
B、swing在不同的操作系统中显示相同的风格
C、java.awt的子类
D、awt和swing都支持事件模型
23、[单选题] 给出如下代码: class test{ private int m; public static void fun() { // some code... } } 如何使成员变量m 被函数fun()直接访问( )。A、将private int m 改为protected int m
B、将private int m 改为 public int m
C、将private int m 改为 static int m
D、将private int m 改为 int m
24、[判断题] Java的字符类型采用的是Unicode编码,但所占字节由具体软硬件环境决定( )A、错误
B、正确
25、[多选题] 说明下列创建数组的方法那些是正确的( )。A、int twoDim[][] = new int[4][];
B、int twoDim[][] = new int[][4];
C、int twoDim[][] = new int[4][5];
D、char a[] = {‘A’, ‘B’};