lass 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++;
44. FilterOutputStream is the parent class for BufferedOutputStream, DataOutputStream and PrintStream. Which classes are valid argument for上一页 [1] [2] [3] [4] [5] [6] 下一页 |