aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Ques. from JTips Mock 1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Ques. from JTips Mock 1" Watch "Ques. from JTips Mock 1" New topic
Author

Ques. from JTips Mock 1

Vijay Narayanan
Ranch Hand

Joined: Sep 09, 2001
Posts: 50
True or False?
Unsigned Right Shift on a Negative Integer always returns
a Positive Integer.
The answer is False.
I feel it should be True. Plz someone explain...


<b>Sun Certified Java Programmer</b> <i>for the Java 2 Platform</i><br /><b>PMP</b>
Adrian Muscalu
Ranch Hand

Joined: May 08, 2000
Posts: 73
This have been recently discussed here, on this forum. The answer is relative simple since -1 >>> 32 returns -1. This is one case that should clear any doubts.
Best regards


SCJP2, SCWCD
Vijay Narayanan
Ranch Hand

Joined: Sep 09, 2001
Posts: 50
could anyone tell me how -1>>>32 has been evaluated. bcoz i tried it out and i got -1 as the answer
Vijay Narayanan
Ranch Hand

Joined: Sep 09, 2001
Posts: 50
what is the binary representation of -1.
Jim Petersen
Ranch Hand

Joined: Jul 24, 2001
Posts: 241
Hi Vijay
This should help!
http://www.jchq.net/tutorial/BitShift.htm
rgds Jim


- Jim Petersen <br />SCJP2<br />SCWCD<p>- but then again, I could be wrong...
 
 
subject: Ques. from JTips Mock 1