"SCJP5 | SCWCD5| DEVELOPER"
"SCJP5 | SCWCD5| DEVELOPER"
Sun Certified Java Programmer<BR>Oracle Certified DBA
Originally posted by sdev:
This below question is from the website -http://209.242.122.83/JavaCertification.html
What is the result of the following fragment of code?
(byte)0x81>>2
a. 0x20
b. 0x3FFFFFE0
c. 0XE0
d. 0xFFFFFFE0
I don't know the answer, but I want to know that, will this type of questions appear in the real exam
Thank you.......
Originally posted by sanjay gautam:
hello sdev,
ans of this question will be 0XE0.
explanation----
1)first convert this number in binary , it will come out 1000001
2)after >>2 it will be 11100000, bcoz of signed right shift.
3)again change it in hex it will come out 0xE0.
i think i am right . if any doubt please write me ,
gautam
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |