File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Bit shifting 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 "Bit shifting" Watch "Bit shifting" New topic
Author

Bit shifting

Arsho, Ayan
Ranch Hand

Joined: Nov 14, 2001
Posts: 60
<code>
Hi all
Could some one explain why the result of
l >> 32 (where long l = 1) and i >> 32(where int i = 1) is different?
Thanks in advance
BTW i read somewhere that this forum is going to be closed soon after jan 1st 2002, is it true??
</code>
Jane Griscti
Ranch Hand

Joined: Aug 30, 2000
Posts: 3141
Hi arsho,
A long has 64-bits and an int 32-bits so shifting bits with i>>32 wraps the bits.
Check out the Cat and Mouse Games with Bits tutorial for how bit-shifting works.

BTW i read somewhere that this forum is going to be closed soon after jan 1st 2002, is it true??

No. Someone is pulling your leg
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform
Co-author Mike Meyers' Java 2 Certification Passport


Jane Griscti
SCJP, Co-author Mike Meyers' Java 2 Certification Passport
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Bit shifting