-此次很幸运没出现什么大问题,大概都能解决。只是发现编程真是一个须要细心的事情。java
(本周代码输入状况)git
错题1及缘由,理解状况:
A cast is required in which of the following situations? (下列哪一种状况须要强制转换?)
A . using charAt to take an element of a String and store it in a char (使用charAt来获取字符串元素并将其存储为char类型)
B . storing an int in a float (将一个int类型的数存储为float类型)
C . storing a float in a double (将一个float类型的数存储为double类型)
D . storing a float in an int (将一个float类型的数存储为int类型)
E . all of the above require casts (以上全部状况都须要强制转换)编程
个人答案:E 正确答案:D
现在分析与理解数据类型转换时double>float>long>int>char>shart>byte.逆向转换需声明数据结构
错题2及缘由,理解状况:
Which of the following is true regarding the mod operator, %? (关于求余运算符%,下面哪项是正确的?)
A . It can only be performed on int values and its result is a double (它只能执行int类型的数值,其结果是double类型的数)
B . It can only be performed on int values and its result is an int (它只能执行int类型的数值,其结果也是int类型的数)
C . It can only be performed on float or double values and its result is an int (它只能执行float或者double类型的数值,其结果是int类型的数)
D . It can only be performed on float or double values and its result is a double (它只能执行float或者double类型的数值,其结果是double类型的数)
E . It can be performed on any numeric values, and the result always is numeric (它能够执行任何类型的数值,其结果始终是数值)dom
个人答案:B 正确答案:E
错误缘由:测试前作过相关的一个程序,关于Double型数据能不能求余。由于那个程序有一些其余的错误致使我觉得Double型数据不能求余!!!但其实时能够求得。学习
错题3及缘由,理解状况:
What is output with the statement System.out.println(x+y); if x and y are int values where x=10 and y=5? (若是x和y是int类型的数值,x=10,y=5,那么语句System.out.println(x+y);的输出是什么?)
A . 15
B . 105
C . 10 5
D . x+y
E . An error since neither x nor y is a String (因x和y都不是字符串而引发的一个错误)测试
个人答案:B 正确答案:A
错误缘由:混淆了数字加法与字符串的拼接。数字的加法时会用括号括起来。ui
错题4及缘由,理解状况:
What value will z have if we execute the following assignment statement?
int z = 50 / 10.00; (若是咱们执行下面的赋值语句,z将获得什么值?)
A . 5
B . 5.0
C . 50
D . 10
E . none of the above, a run-time error arises because z is an int and 50 / 10.00 is not (以上皆错,因z是一个整型数而50 / 10.00不是,会产生运行时错误)设计
个人答案:A 正确答案:E
理解状况:弄错了数据类型转换时应该生命的位置。若是答案是A时其问题应该时z=(int)(50/10.00).调试
错题5及缘由,理解状况:
You cannot cast a String to be a char and you cannot cast a String which stores a number to be an int, float or double. (你不能将字符串强制转换为char类型,也不能将一个字符串强制转换为int、float或double类型。)
A . true
B . false
个人答案:B 正确答案:A
错误缘由:对char类型不熟悉。char类型在Java语言中,表明一个字符,且只能表示一个!
错题6及缘由,理解状况:
A variable of type boolean will store either a 0 or a 1. (Boolean类型的变量将被存储为0或1)
A . true
B . false
个人答案:A 正确答案:B
错误缘由:电脑中的数据都是二进制0 或者1存储的,因此觉得就是对的。布尔型只包含两个有效值:true and false.不能转换成其余任何类型的值。可是这说的时储存啊,储存不就是0 or 1 吗??还请老师或者助教讲解一下
代码行数(新增/累积) | 博客量(新增/累积) | 学习时间(新增/累积) | 重要成长 | |
---|---|---|---|---|
目标 | 5000行 | 30篇 | 400小时 | |
第一周 | 072/200 | 1/1 | 05/20 | |
第二周 | 300/500 | 2/2 | 18/38 | |
第三周 | 972 /1000 | 4 /4 | 39/60 |