ImageVerifierCode 换一换
格式:DOC , 页数:51 ,大小:65.36KB ,
资源ID:1283225      下载积分:3 金币
验证码下载
登录下载
邮箱/手机:
验证码: 获取验证码
温馨提示:
支付成功后,系统会自动生成账号(用户名为邮箱或者手机号,密码是验证码),方便下次登录下载和查询订单;
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

开通VIP
 

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

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  
声明  |  会员权益     获赠5币     写作写作

1、填表:    下载求助     索取发票    退款申请
2、咨信平台为文档C2C交易模式,即用户上传的文档直接被用户下载,收益归上传人(含作者)所有;本站仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。所展示的作品文档包括内容和图片全部来源于网络用户和作者上传投稿,我们不确定上传用户享有完全著作权,根据《信息网络传播权保护条例》,如果侵犯了您的版权、权益或隐私,请联系我们,核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
3、文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为仲裁依据,平台无法对文档的真实性、完整性、权威性、准确性、专业性及其观点立场做任何保证或承诺,下载前须认真查看,确认无误后再购买,务必慎重购买;若有违法违纪将进行移交司法处理,若涉侵权平台将进行基本处罚并下架。
4、本站所有内容均由用户上传,付费前请自行鉴别,如您付费,意味着您已接受本站规则且自行承担风险,本站不进行额外附加服务,虚拟产品一经售出概不退款(未进行购买下载可退充值款),文档一经付费(服务费)、不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
5、如你看到网页展示的文档有www.zixin.com.cn水印,是因预览和防盗链等技术需要对页面进行转换压缩成图而已,我们并不对上传的文档进行任何编辑或修改,文档下载后都不会有水印标识(原文档上传前个别存留的除外),下载后原文更清晰;试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓;PPT和DOC文档可被视为“模板”,允许上传人保留章节、目录结构的情况下删减部份的内容;PDF文档不管是原文档转换或图片扫描而得,本站不作要求视为允许,下载前自行私信或留言给上传者【精****】。
6、本文档所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用;网站提供的党政主题相关内容(国旗、国徽、党徽--等)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
7、本文档遇到问题,请及时私信或留言给本站上传会员【精****】,需本站解决可联系【 微信客服】、【 QQ客服】,若有其他问题请点击或扫码反馈【 服务填表】;文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“【 版权申诉】”(推荐),意见反馈和侵权处理邮箱:1219186828@qq.com;也可以拔打客服电话:4008-655-100;投诉/维权电话:4009-655-100。

注意事项

本文(Java练习题1(有答案).doc)为本站上传会员【精****】主动上传,咨信网仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知咨信网(发送邮件至1219186828@qq.com、拔打电话4008-655-100或【 微信客服】、【 QQ客服】),核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载【60天内】不扣币。 服务填表

Java练习题1(有答案).doc

1、第 1题 _ is an object-oriented programming language. 1、 Java 2、 C+ 3、 C 4、 Ada 5、 Pascal 答案 1 2 第 2题 _ is Architecture-Neutral. 1、 Java 2、 C+ 3、 C 4、 Ada 5、 Pascal 答案 1 第 3题 _ is a technical definition of the language that includes the syntax and semantics of the Java programming language. 1、 Java lan

2、guage specification 2、 Java API 3、 Java JDK 4、 Java IDE 答案 1 第 4题 _ consists of a set of separate programs for developing and testing Java programs, each of which is invoked from a command line. 1、 Java language specification 2、 Java API 3、 Java JDK 4、 Java IDE 答案 3 第 5题 _ provides an integrated dev

3、elopment environment (IDE) for rapidly developing Java programs. Editing, compiling, building, debugging, and online help are integrated in one graphical user interface. 1、 Java language specification 2、 Java API 3、 Java JDK 4、 Java IDE 答案 4 第 6题 The main method header is written as: 1、 public stati

4、c void main(string args) 2、 public static void Main(String args) 3、 public static void main(String args) 4、 public static main(String args) 5、 public void main(String args) 答案 3 第 7题 Which of the following statements is correct? 1、 Every line in a program must end with a semicolon. 2、 Every statemen

5、t in a program must end with a semicolon. 3、 Every comment line must end with a semicolon; 4、 Every method must end with a semicolon; 5、 Every class must end with a semicolon; 答案 2 第 8题 Which of the following statements is correct to display Welcome to Java on the console? 1、 Welcome to Java ); 2、 W

6、elcome to Java); 3、 System.println( Welcome to Java ); 4、 Welcome to Java ); 5、 Welcome to Java); 答案 2 5 第 9题 Which JDK command is correct to run a Java application in ByteCode.class? 1、 java ByteCode 2、 java ByteCode.class 3、 javac ByteCode.java 4、 javac ByteCode 5、 JAVAC ByteCode 答案 1 第 10题 Suppos

7、e you define a Java class as follows: public class Test In order to compile this program, the source code should be stored in a file named 1、 Test.class 2、 Test.doc 3、 Test.txt 4、 Test.java 5、 Any name with extension .java 答案 4 第 11题 The extension name of a Java bytecode file is 1、 .java 2、 .obj 3、

8、.class 4、 .exe 答案 3 第 12题 Which of the following lines is not a Java comment? 1、 /* comments */ 2、 / comments 3、 - comments 4、 /* comments */ 5、 * comments * 答案 3 5 第 13题 Which of the following are the reserved words? 1、 public 2、 static 3、 void 4、 class 答案 1 2 3 4 第 14题 To use JOptionPane in your p

9、rogram, you may import it using: 1、 import ; 2、 import javax.swing.*; 3、 import javax.*; 4、 import javax.*.JOptionPane; 答案 1 2 第 15题 Which of the following are correct names for variables according to Java naming conventions? 1、 radius 2、 Radius 3、 RADIUS 4、 findArea 5、 FindArea 答案 1 4 第 16题 Which o

10、f the following are correct ways to declare variables? 1、 int length; int width; 2、 int length, width; 3、 int length; width; 4、 int length, int width; 答案 1 2 第 17题 _ is the Java assignment operator. 1、 = 2、 := 3、 = 4、 =: 答案 3 第 18题 Which of the following assignment statements is incorrect. 1、 i = j

11、= k = 1; 2、 i = 1; j = 1; k = 1; 3、 i = 1 = j = 1 = k = 1; 4、 i = j = k = 1; 答案 3 4 第 19题 Which of the following is a constant, according to Java naming conventions? 1、 MAX_VALUE 2、 Test 3、 read 4、 ReadInt 5、 COUNT 答案 1 5 第 20题 To declare an int variable number with initial value 2, you write 1、 int

12、 number = 2L; 2、 int number = 2l; 3、 int number = 2; 4、 int number = 2.0; 答案 3 第 21题 Which of the following expressions will yield 0.5? 1、 1 / 2 2、 1.0 / 2 3、 (double) (1 / 2) 4、 (double) 1 / 2 5、 1 / 2.0 答案 2 4 5 第 22题 Which of the following expression results in a value 1? 1、 2 % 1 2、 15 % 4 3、 25

13、 % 5 4、 37 % 6 答案 4 第 23题 -25 % 5 is _ 1、 1 2、 2 3、 3 4、 4 5、 0 答案 5 第 24题 -24 % -5 is _ 1、 3 2、 -3 3、 4 4、 -4 5、 0 答案 4 第 25题 To add number to sum, you write (Note: Java is case-sensitive) 1、 number += sum; 2、 number = sum + number; 3、 sum = Number + sum; 4、 sum += number; 5、 sum = sum + number; 答案

14、 4 5 5第 26题 Suppose x is 1. What is x after x -= 1? 1、 0 2、 1 3、 2 4、 -1 5、 -2 答案 1 第 27题 What is x after the following statements? int x = 1; int y = 2; x *= y + 1; 1、 x is 1; 2、 x is 2; 3、 x is 3; 4、 x is 4; 答案 3 第 28题 What is y displayed? public class Test public static void main(String args) int

15、 x = 1; int y = x + x+; y is + y); 1、 y is 1. 2、 y is 2. 3、 y is 3. 4、 y is 4. 答案 2 第 29题 What is y displayed in the following code? public class Test public static void main(String args) int x = 1; int y = x+ + x; y is + y); 1、 y is 1. 2、 y is 2. 3、 y is 3. 4、 y is 4. 答案 3 第 30题 What is the printou

16、t of the following code: double x = 5.5; int y = (int)x; x is + x + and y is + y); 1、 x is 5 and y is 6 2、 x is 6.0 and y is 6.0 3、 x is 6 and y is 6 4、 x is 5.5 and y is 5 5、 x is 5.5 and y is 5.0 答案 4 第 31题 Suppose x is a char variable with a value b . What is the printout of the statement 1、 a 2、

17、 b 3、 c 4、 d 答案 3 第 32题 Suppose i is an int type variable. Which of the following statements display the character whose Unicode is stored in variable i? 1、 ; 2、 ; 3、 ; 4、 + ); 答案 2 第 33题 The following code fragment reads in two numbers: Scanner input = new Scanner(System.in); int i = input.nextInt(

18、); double d = input.nextDouble(); What are the correct ways to enter these two numbers? 1、 Enter an integer, a space, a double value, and then the Enter key. 2、 Enter an integer, two spaces, a double value, and then the Enter key. 3、 Enter an integer, an Enter key, a double value, and then the Enter

19、 key. 4、 Enter a numeric value with a decimal point, a space, an integer, and then the Enter key. 答案 1 2 3 第 34题 If you enter 1 2 3, when you run this program, what will be the output? import ; public class Test1 public static void main(String args) Scanner input = new Scanner(System.in); Enter thre

20、e numbers: ); double number1 = input.nextDouble(); double number2 = input.nextDouble(); double number3 = input.nextDouble(); / Compute average double average = (number1 + number2 + number3) / 3; / Display result ; 1、 1.0 2、 2.0 3、 3.0 4、 4.0 答案 2 第 35题 The expression (int)(76.0252175 * 100) / 100 ev

21、aluates to _. 1、 76.02 2、 76 3、 76.0252175 4、 76.03 答案 2 第 36题 According to Java naming convention, which of the following names can be variables? 1、 FindArea 2、 findArea 3、 totalLength 4、 TOTAL_LENGTH 5、 class 答案 2 3 第 37题 The _ method displays an input dialog for reading a string. 1、 String string

22、 = JOptionPane.showMessageDialog(null, Enter a string, Input Demo, JOptionPane.QUESTION_MESSAGE); 2、 String string = JOptionPane.showInputDialog(null, Enter a string, Input Demo, JOptionPane.QUESTION_MESSAGE); 3、 String string = JOptionPane.showInputDialog(Enter a string, Input Demo, JOptionPane.QUE

23、STION_MESSAGE); 4、 String string = JOptionPane.showInputDialog(null, Enter a string); 5、 String string = JOptionPane.showInputDialog(Enter a string); 答案 2 4 5 第 38题 Analyze the following code. import javax.swing.*; public class ShowErrors public static void main(String args) int i; int j; String s =

24、 JOptionPane.showInputDialog(null, Enter an integer, Input, JOptionPane.QUESTION_MESSAGE); j = Integer.parseInt(s); 7i = (i + 4); 1、 The program cannot compile because j is not initialized. 2、 The program cannot compile because i does not have an initial value when it is used in i = i + 4; 3、 The pr

25、ogram compiles but has a runtime error because i does not have an initial value when it is used in i = i + 4; 4、 The program compiles and runs fine. 答案 2 第 39题 Suppose x=10 and y=10. What is x after evaluating the expression (y 10) & (x- 10)? 1、 9 2、 10 3、 11 答案 2 第 40题 Suppose x=10 and y=10 what is

26、 x after evaluating the expression (y = 10) | (x+ 10). 1、 9 2、 10 3、 11 答案 2 第 41题 Suppose x = 1, y = -1, and z = 1. What is the printout of the following statement? (Please indent the statement correctly first.) if (x 0) if (y 0) x 0 and y 0); else if (z 0) x 0); 1、 x 0 and y 0; 2、 x 0; 3、 x 0 and

27、z = 100) too hot); else if (temperature 0 & x 0) & (x 0 | x 0) | (x 0 | x 10 & y 0 | (x 10 & y 0 | x 10 & y 0 | x 10) & y 0) 答案 1 2 3 第 54题 How many times will the following code print Welcome to Java? int count = 0; while (count 10) Welcome to Java); count+; 1、 8 2、 9 3、 10 4、 11 5、 0 答案 3 第 55题 An

28、alyze the following code. int count = 0; while (count 100) / Point A Welcome to Java!); count+; / Point B / Point C 1、 count 100 is always true at Point A 2、 count 100 is always true at Point B 3、 count 100 is always false at Point B 4、 count 100 is always true at Point C 5、 count 100 is always fals

29、e at Point C 答案 1 5 第 56题 How many times will the following code print Welcome to Java? int count = 0; do Welcome to Java); while (count+ 10); 1、 8 2、 9 3、 10 4、 11 5、 0 答案 4 第 57题 What is the value in count after the following loop is executed? int count = 0; do Welcome to Java); while (count+ 9);

30、; 1、 8 2、 9 3、 10 4、 11 5、 0 答案 3 第 58题 Do the following two statements in (I) and (II) result in the same value in sum? (I): for (int i = 0; i10; +i) sum += i; (II): for (int i = 0; i10; i+) sum += i; 1、 Yes 2、 No 答案 1 第 59题 Is the following loop correct? for (; ; ); 1、 Yes 2、 No 答案 1 第 60题 Analyze

31、 the following code: public class Test public static void main (String args) int i = 0; for (i = 0; i 10; i+); + 4); 1、 The program has a compile error because of the semicolon (;) on the for loop line. 2、 The program compiles despite the semicolon (;) on the for loop line, and displays 4. 3、 The program compiles despite the semicolon (;) on the for loop line, and displays 14. 4、 The for loop in this program is same as for (i = 0; i 4) break; while (item 5); 1、 5 2、 6 3、 7 4、 8 答案 2 第 63题 After the continue outer statement is exec

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        获赠5币

©2010-2024 宁波自信网络信息技术有限公司  版权所有

客服电话:4008-655-100  投诉/维权电话:4009-655-100

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :gzh.png    weibo.png    LOFTER.png 

客服