2、下面程序运行结果为()public class test3 {public static void main(String args[]) {int count=0;for (int i=0;i<=100;i++)count+=count++;}System.out.println( count );}ABc D
A. 0
B. 7
C. 编译有错误
D. 其他答案
查看答案
4、下面初始化数组语句()是不正确的。
A. int x[] = {1,2,3};
B. int x[3] = {1,2,3};
C. int[] x = {1,2,3};
D. int x[] = new int[]{1,2,3};
5、指出下列程序运行的结果 ( )public class Example{String str=new String("good");char[]ch={'a','b','c'};public static void main(String args[]){Example ex=new Example();ex.change(ex.str,ex.ch);System.out.print(ex.str+" and ");System.out.print(ex.ch);}public void change(String str,char ch[]){str="test ok";ch[0]='g';}}
A. good and abc
B. good and gbc
C. test ok and abc
D. test ok and gbc
2、若在某一个类定义中定义有如下的方法:finalvoid aFinalFunction( );则该方法属于( )。
A. 本地方法
B. 静态方法
C. 最终方法
D. 抽象方法
13、类与对象的关系是()。
A. 类是对象的抽象
B. 类是对象的具体实例
C. 对象是类的抽象
D. 对象是类的子类