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 shift operators Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "shift operators " Watch "shift operators " New topic
Author

shift operators

Raghav Mathur
Ranch Hand

Joined: Jan 12, 2001
Posts: 641
int i =10
int result = i<< 4;
as a thumb rule .... this means ,int result = 10*2 to the power 4;
int result = i>>4
as a thumb rule .... this means ,int result = 10/2 to the power 4 ;

please if anybody could explain me >>> operator .


Raghav.
Rob Ross
Bartender

Joined: Jan 07, 2002
Posts: 2205
>>> is the unsigned shift operator.
You have to understand how the shift operator really works to understand the difference. Your rules of thumb are true, but they aren't going to help you understand >>>. There are a lot of threads that deal with this topic alread. Do a search in this forum for "shift" and you'll get your answer.


Rob
SCJP 1.4
Raghav Mathur
Ranch Hand

Joined: Jan 12, 2001
Posts: 641
i would really appreciate if you could explain it to me . I like to make thumb rules as it makes me understand a pirticular thing ,well .
thanks in advance
raghav mathur
Originally posted by Rob Ross:
>>> is the unsigned shift operator.
You have to understand how the shift operator really works to understand the difference. Your rules of thumb are true, but they aren't going to help you understand >>>. There are a lot of threads that deal with this topic alread. Do a search in this forum for "shift" and you'll get your answer.
Rodney Woodruff
Ranch Hand

Joined: Dec 04, 2001
Posts: 80
Try this link. It helped me alot.
http://www.javaranch.com/campfire/StoryBits.jsp


Hope This Helps
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: shift operators