当前位置: 技术问答>java相关
一道摸拟题求解!
来源: 互联网 发布时间:2015-05-01
本文导语: Which of the following are correct. Select all correct answers. A. Java provides two operators to do left shift - is the signed right shift operator. D. For positive numbers, results of operators >> and >>> are same. 答案是d, 我想问b是...
Which of the following are correct. Select all correct answers.
A. Java provides two operators to do left shift - is the signed right shift operator.
D. For positive numbers, results of operators >> and >>> are same.
答案是d, 我想问b是什么意思?
A. Java provides two operators to do left shift - is the signed right shift operator.
D. For positive numbers, results of operators >> and >>> are same.
答案是d, 我想问b是什么意思?
|
>> is the signed right shift operator.
>>> is the zero fill right shift operator.
>>> is the zero fill right shift operator.
|
b 的意思就是在最高位补0的右移位符。
显然不对嘛。
应该是正补0,负补1.
显然不对嘛。
应该是正补0,负补1.
|
B的意思是: >>是右移左端补0运算符
注:>>是右移带符号位运算符
注:>>是右移带符号位运算符
|
如果改成B. >>> is the zero fill right shift operator 就是正确的。
|
b的意思是说:>>是在最高位补零的右移运算符。
|
b是错的
>>对正数补0,对负数补1。
>>对正数补0,对负数补1。
|
b的意思是说在最高位补0的右移运算符,但如果是负数就要补1所以不对