This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!See this thread for details.
Big Moose Saloon
 Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies Register / Login Win a copy of Refactoring for Software Design Smells: Managing Technical Debt this week in the OO, Patterns, UML and Refactoring forum!

# 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 .
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

I agree. Here's the link: http://aspose.com/file-tools

subject: shift operators