ImageVerifierCode 换一换
格式:DOCX , 页数:22 ,大小:73.21KB ,
资源ID:9613764      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/9613764.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(JAVA双语教学考试试A卷及答案docx.docx)为本站会员(b****7)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

JAVA双语教学考试试A卷及答案docx.docx

1、JAVA双语教学考试试A卷及答案docx注意事项:请将各题答案按编号顺序填写到答题卷上,答在试卷上无效。-、单项选择题(120每小题1分,21*30每小题2分,共40分)Which statement of assigning a long type variable to a hexadecimal value is correct?A. 0|Pg 曲4.un I5.long number = 345L; B. long number = 0345;C. long number = 0345L; D. long number = 0x345L;Which layout manager is

2、used when the frame is resized the buttonss position in the Frame might be changed?A. BorderLayout B. FlowLayout C. CardLayout D. GridLayout Which are not Java primitive types?A. short B. Boolean C. byte D. floatGiven the following code:if (x0) System.out.println(firstn); else if (x-3) System.out.pr

3、intln(MsecondH); else System.out.println(MthirdH); Which range of x value would print the string usecond11?A. x 0 B. x -3 C. x = -3 D. x -37. Given the following code: public class Person int arr| | = new int| 10; public static void main(String a| ) System.out.println(arr| 11);Which statement is cor

4、rect?A. When compilation some error will occur.B It is correct when compilation but will cause error when running.C. The output is zero.D. The output is null.8. Short answer:The decimal value of i is 13, the octal i value is:A. 14 B. 015 C. 0x14 D. 0129. A public member vairable called MAX_LENGTH wh

5、ich is int type, the value of thevariable remains constant value 100. Use a short statement to define the variable.A. public int MAX_LENGTH=100; B. final int MAX_LENGTH=100;C. final public int MAX_LENGTH=100; D. public final int MAX_LENGTH=100.10. Which correctly create an array of five empty String

6、s?A. String a = f ; B. String a 5; C. String 5 a;D. String a = new String5; for (int i = 0; i 4)System.out.println(HTest An);else if(val 9)System.out.println(uTest Bn);else System.out.println(HTest CH);Which values of val will result in ”Test C” being printed:A. val 920. Which of the following are v

7、alid definitions of an applications main () method?A. public static void main(); B. public static void main( String args );C. public static void main( String args ); D. public static voidmain( Graphics g );21. After the declaration:char c = new char100;what is the value of c50?A. 50 B. ” C. u0032 D.

8、 ,u0000,22. Which of the following statements assigns Hello Java” to the String variable s ?A. String s = Hello Java; B. String s = Hello Java;C. new String s = Hello Java”; D. String s = new String (HelloJava);23.If arr contains only positive integer values, what does this function do?public int gu

9、essWhat(int arr)int x = 0;for(int i = 0; i arr.length; i+)x = x arri ? arri : x;return x;A. Returns the index of the highest element in the arrayB Returns true/false if there are any elements that repeat in the arrayC. Returns how many even numbers are in the arrayD. Returns the highest element in t

10、he array24. Which of the following are legal declarations of a two-dimensional array of integers?A. int55 a = new int; B. int a = new int5,5;C. int aJ = new int 55; D. inta = new 5int5;25.If val = 1 in the code below:switch (val)case 1: System.out.print(nPM);case 2:case 3: System.out.print (nQH);bre

11、ak;case 4: System.out.print(nRn);default: System.out.print (nSu);A. P B. PQ C. QS D. PQRS26. Given the following code:1.public class Test 2.int m, n;3.public Test() 4.public Test(int a) m=a; 5.public static void main(String argJ) 6.Test tl,t2;7.intj,k;&j=0; k=0;9.tl=new Test();10.t2=new Test(j,k);11

12、.12.Which line would cause one error during compilation?A. line 3 B. line 5 C. line 6 D. line 1027. For the code:m = 0;while( +m 2 )System.out.println(m);Which of the following are printed to standard output?A. 0 B. 1 C. 2 D. 328. Consider the following code: What will happen when you try to compile

13、 it?public class InnerClasspublic static void main(StringJargs)public class Mylnnerf A. It will compile fine.B It will not compile, because you cannot have a public inner class.C. It will compile fine, but you cannot add any methods, because then it will fail to compile.D. It will compile fail.29. W

14、hat is the result of executing the following code:public class Testpublic static void main(String args) String word 二 MrestructureM;System.out.println(word.substring(2, 5);A. rest B. es C. str D. st30. What will be written to the standard output when the following program is run? public class Test p

15、ublic static void main(String argsfl) System.out.println(9 A 2);3L When call fact(3), What is the result?int fact(int n)if(n=l) return 1;elsereturn nfact(n-l);D. 0D. abedA. 2 B. 6 C. 332. What is the result of executing the following code: String s=new String(HabcdefgH);for(int i=0;is.length();i+=2)

16、System.out.print(s.char At(i);A. aceg B. bdf C. abcdefg33- What is the result of executing the following code: public class Test public static void changeStr(String str) str=nwelcomeH;public static void main(String args) String st” 12345”; changeStr(str);System.out.println(str);Please write the outp

17、ut result :A. welcome B. 12345 C. welcomel2345D. 12345welcome34. What is the result of executing the following code:1. public class Test 2. static boolean foo(char c) 3. System.out.print(c);4. return true;5. 6. public static void main( String argv ) 7. int i=0;& for ( foo(A); foo(B)&(i2); foo(C)9. i

18、+ ;10. foo(D);12. 13. 14. What is the result?A. ABDCBDCB B. ABCDABCDC. Compilation fails. D. An exception is thrown at runtime.35. What will happen when you attempt to compile and run the following code?public final class Test4class Innervoid test()if (Test4.this.flag);elsesample();private boolean f

19、lag=false;public void sample()System.out.println(HSampleH);public Test4()(new Inner().test();public static void main(String args) new Test4();What is the result:A. Print out SampleB Program produces no output but termiantes correctly.C. Program does not terminate.D. The program will not compile36. W

20、hat is the result of executing the following fragment of code: class Base Base()amethod();int i= 100;public void amethod()System.o u 匚 println(nBase.amethod()H);public class Derived extends Baseint i = -1;public static void main(String argv) Base b = new Derived();System.out.println(b.i); b.amethod(

21、);public void amethod()System.out.println(HDerived.amethod()n);A. Derived.amethod()Derived.amethod()C. 100Derived.amethod()B. Derived.amethod()100Derived.amethod() D. Compile time errorpublic class Test String sl=nmenun;public static void main(String args) int z=2;Test t=new Test();System.out.printl

22、n(t.sl+z);38. What is the result of executing the following code: public class Test implements A int x=5;public static void main(String args) Test cl = new Test();System.out.println(c l.x+A.k);interface A intk= 10;D. 105A. 5 B. 10 C. 1539- What is the result of executing the following code: import j

23、ava.util. Arrays;public class Test public static void main(String unused) String str = xxx”,”zzz,”yyy”,”aaa;Arrays.sort(str);int index=Arrays.binarySearch(str,Hzzzn); if(index=-l)System.out.println(HnoH);elseSystem.out.println(HyesH);A. no B. xxx C. 0 D. yesD. 35D. 16D. 3int b=2,3,4,5,6,7,8;int sum=O;for(int i=O;ivbength;i+) for(int j=O;jbiength;j+) sum+=biU;System.out.println(,sum=,4-sum);A. 9 B. 11 C. 1541. What is the result of executing t

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1