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 JQPlus ---shift operator Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "JQPlus ---shift operator" Watch "JQPlus ---shift operator" New topic
Author

JQPlus ---shift operator

Ash sav
Ranch Hand

Joined: Apr 14, 2001
Posts: 55
Whether it's true or false
value returned by >>> will never be negative
Answer is false and they give following explantion.
for RHS of 32, no shifting will be done and same(if-ve then -ve and if +ve then +ve)
Can somebody explain me what is mean by RHS of 32 by giving an example. Is this related to int widht?
Thanks in advance
Ash
Rajesh Patil
Greenhorn

Joined: May 21, 2001
Posts: 5
Hi Ash,
The width of an Integer is 4 Bytes i.e. 32 Bits. So it
can be shifted logically 32 times.
If shift is by 33 then the actual shift occurs 33%32 times
i.e. once only. Now 32%32=0 so No shift
when you try to an int by 32!
Also a long can be shifted 64%x times.

------------------
rptl
[This message has been edited by Rajesh Patil (edited May 24, 2001).]


rptl
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JQPlus ---shift operator
 
Similar Threads
Shift with -ve operand???
am i true (shift operators)
Jxam short circuit question
Doubt on operators
Shift Operator