Java程序员认证模拟试题
来源:优易学  2011-11-28 13:07:11   【优易学:中国教育考试门户网】   资料下载   IT书店

 

35. Run a corrected class: java ?Ccs AClass a b c
Which statement is true?
A. args[0]=”-cs”;
B. args[1]=”a b c”;
C. args[0]=”java”;
D. args[0]=”a”; E. args[1]=?b?

36. Give the following java class:
public class Example{
static int x[]=new int[15];
public static void main(String args[]){
System.out.println(x[5]);
}
}
Which statement is corrected?
A. When compile, some error will occur.
B. When run, some error will occur.
C. Output is zero.
D. Output is null.

37. Give the following java class:
public class Example{
public static void main(String args[]){
static int x[] = new int[15];
System.out.println(x[5]);
}
}
Which statement is corrected?
A. When compile, some error will occur.
B. When run, some error will occur.
C. Output is zero.
D. Output is null.

38. Short answer:
The decimal value of i is 12, the octal i value is:

39. Short answer:
The decimal value of i is 7, the hexadecimal i value is:

40. Which is the range of char?
A. 27~27-1
B. 0~216-1
C. 0~216
D. 0~28

41. Which is the range of int type?
A. -216~216-1
B.- 231~231-1
C. -232~232-1
D. -264~264-1

42. Give the following class:
public class Example{
String str=new String(“good”);
char ch[]={
public static void main(String args[]){
Example ex=new Example();
ex.change(ex.str,ex.ch);
System.out.println(ex.str+”and”+ex.ch);
}
public void change(String str,char ch[]){
str=”test ok”;ch[0]=?g?
}
}
Which is the output:
A. good and abc
B. good and gbc
C. test ok and abc
D. test ok and gbc

43. Which code fragments would correctly identify the number of arguments passed via command line to a Java application, exclude the name of the class that is being invoke.
A. int count = args.length;
B. int count = args.length-1;
C. int count=0; while(args[count]!=null)
count++;
D. int count=0;while
(!(args[count].equals(“”))) count++;

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] 下一页

责任编辑:小草

文章搜索:
 相关文章
热点资讯
热门课程培训