- 1、本文档共35页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
面向对象编程基础习题及答案
Choice Questions (1pt for each question).
To add a to b and store result in b, you write (Note: Java is case-sensitive)
A. b += a;
B. a = b + a;
C. b = A + b;
D. a += b;
To declare a constant PI, you write
A. final static PI = 3.14159;
B. final float PI = 3.14159;
C. static double PI = 3.14159;
D. final double PI = 3.14159;
To improve readability and maintainability, you should declare _________ instead of using literal values such as 3.14159.
A. variables
B. methods
C. constants
D. classes
To declare an int variable x with initial value 200, you write
A. int x = 200L;
B. int x = 200l;
C. int x = 200;
D. int x = 200.0;
To assign a double variable d to an int variable x, you write
A. x = (long)d
B. x = (int)d;
C. x = d;
D. x = (float)d;
In Java, the word true is ________.
A. a Java keyword
B. a Boolean literal
C. same as value 1
D. same as value 0
Which of the Boolean expressions below has incorrect syntax?
A. (true) (3 4)
B. !(x 0) (x 0)
C. (x 0) || (x 0)
D. (x != 0) || (x = 0)
Which of the following is the correct expression that evaluates to true if the number x is between 1 and 100 or the number is negative?
A. 1 x 100 x 0
B. ((x 100) (x 1)) || (x 0)
C. ((x 100) (x 1)) (x 0)
D. (1 x 100) || (x 0)
Which of the following is the correct expression of character a?
A. a
B. a
C. \000a
D. None of the above.
Which of the following statement prints smith\exam1\test.txt?
A. System.out.println(smith\exam1\test.txt);
B. System.out.println(smith\\exam1\\test.txt);
C. System.out.println(smith\exam1\test.txt);
D. System.out.println(smith\exam1\test.txt);
Suppose i is an int type variable. Which of the following statements display the character whose Unicode is stored in variable i?
A. System.out.println(i);
B. System.out.println((char)i);
C. System.out.println((int)i);
D. System.out.println(i + );
The Unicode of a is 97. What is the Unicode for c?
A. 96
B. 97
C. 98
D. 99
Which of the following is a constant, according to Java naming
您可能关注的文档
- 陈文博开题报告.doc
- 成都JAVA面试题目.doc
- 成为java高手的20个目标.doc
- 成为Java高手的25个学习目标.doc
- 成为java高手的八大条件.doc
- 程式员安全 免费.doc
- 程序设计基础习题答案.doc
- 程序设计习题及答案.doc
- 程序员(JAVA)_3级.doc
- 程序员学习建议.doc
- 新解读《GB_T 23703.5 - 2010知识管理 第5部分:实施指南》最新解读.docx
- 2023-2024学年辽宁沈阳皇姑区七年级下册英语期末试卷及答案.pdf
- 新解读《GB_T 23703.6-2010知识管理 第6部分:评价》最新解读.docx
- 医用电子病历系统优化与智能化.pptx
- 医用康复设备在慢性病治疗中的作用.pptx
- 新解读《GB_T 18623-2011地理标志产品 镇江香醋》最新解读.docx
- 新解读《GB_T 18790 - 2010联机手写汉字识别系统技术要求与测试规程》最新解读.docx
- 围绕煤炭运输过程中的包装形式和防护措施制定标准,减少运输损耗。.doc
- 新解读《GB_T 18823-2010饲料检测结果判定的允许误差》最新解读.docx
- 新解读《GB_T 19882.211-2010自动抄表系统 第211部分:低压电力线载波抄表系统 系统要求》最新解读.docx
文档评论(0)