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

加入VIP,免费下载
 

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

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

下载须知

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

版权提示 | 免责声明

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

java考试选择题英文版.docx

1、java考试选择题英文版Read the questions carefullyI have tried to make the questions unambiguous (the meaning should be obvious), but make sure you have read what I have written not what you think I might have written. Thus if it says Classes can be declared with the private modifier , it means It is possible

2、 to declare a class with the private modifier and not that all classes in all situations can be declared as private. Each question may have one or more correct Answers. QuestionsQuestion 1)Which of the following lines will compile without warning or error. 1) float f=1.3; 2) char c=a; 3) byte b=257;

3、 4) boolean b=null; 5) int i=10; Question 2)What will happen if you try to compile and run the following code public class MyClass public static void main(String arguments) amethod(arguments); public void amethod(String arguments) System.out.println(arguments); System.out.println(arguments1); 1) err

4、or Cant make static reference to void amethod. 2) error method main not correct 3) error array must include parameter 4) amethod must be declared with String Because main is defined as static you need to create an instance of the class in order to call any non-static methods.-Question 3)Which of the

5、 following will compile without error 要先出现package1) import java.awt.*;package Mypackage;class Myclass 2) package MyPackage;import java.awt.*;class MyClass3) /*This is a comment */package MyPackage;import java.awt.*;class MyClass-Question 4)A byte can be of what size 1) -128 to 127 2) (-2 power 8 )-1

6、 to 2 power 8 3) -255 to 256 4)depends on the particular implementation of the Java Virtual machine -Question 5)What will be printed out if this code is run with the following command line? Java myprog good morning;public class myprog public static void main(String argv) System.out.println(argv2); 1

7、) myprog 2) good 3) morning 4) Exception raised: java.lang.ArrayIndexOutOfBoundsException: 2 -Question 6)Which of the following are keywords or reserved (预定义)words in Java? 1) if 2) then 3) goto 4) while 5) case -Question 7)Which of the following are legal identifiers(标识符) 1) 2variable 2) variable2

8、3) _whatavariable 4) _3_ 5) $anothervar 6) #myvar -Question 8)What will happen when you compile and run the following code? public class MyClass static int i; public static void main(String argv) System.out.println(i); 局部变量(在函数内部)必须先初始化,类级别的可以不初始化Class level variables are always initialised to defau

9、lt values. In the case of an int this will be 0. Method level variables are not given default values and if you attempt to use one before it has been initialised it will cause the Error Variable i may not have been initialized1) Error Variable i may not have been initialized 2) null 3) 1 4) 0 -Quest

10、ion 9)What will happen if you try to compile and run the following code? public class Q public static void main(String argv) int anar=new int1,2,3; System.out.println(anar1); 1) 1 2) Error anar is referenced before it is initialized 3) 2 4) Error: size of array must be defined -Question 10)What will

11、 happen if you try to compile and run the following code? public class Q public static void main(String argv) int anar=new int5; System.out.println(anar0); 1) Error: anar is referenced before it is initialized 2) null 3) 0 4) 5 -Question 11)What will be the result of attempting to compile and run th

12、e following code? abstract class MineBase abstract void amethod(); static int i;public class Mine extends MineBase public static void main(String argv) int ar=new int5; for(i=0;i 2);will output a result larger than 10 无符号右移2) System.out.println( -1 2); will output a positive number 输出 -13) System.ou

13、t.println( 2 1); will output the number 1 4) System.out.println( 1 2); will output the number 4-Question 19)What will happen when you attempt to compile and run the following code?public class Tux extends Thread static String sName = vandeleur; public static void main(String argv) Tux t = new Tux();

14、 t.piggy(sName); System.out.println(sName); public void piggy(String sName) sName = sName + wiggy; start(); public void run() for(int i=0;i 4; i+) sName = sName + + i; 1) Compile time error2) Compilation and output of vandeleur wiggy3) Compilation and output of vandeleur wiggy 0 1 2 34) Compilation

15、and output of either vandeleur, vandeleur 0, vandeleur 0 1 vandaleur 0 1 2 or vandaleur 0 1 2 3-Question 20)What will be displayed when you attempt to compile and run the following code /Code startimport java.awt.*;public class Butt extends Frame public static void main(String argv) Butt MyBut=new B

16、utt(); Butt() Button HelloBut=new Button(Hello);Button ByeBut=new Button(Bye); add(HelloBut); add(ByeBut); setSize(300,300); setVisible(true); /Code end1) Two buttons side by side occupying all of the frame, Hello on the left and Bye on the right 2) One button occupying the entire frame saying Hello 3) One button occupying the entire frame saying Bye 4) Two buttons at the top of the frame one saying Hello the other saying Bye -Question 21)What will be output by the following code? public class MyFor public static void main(String argv) int i

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

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