Meaningless Drivel is fun!
The moose likes Beginning Java and the fly likes Shift & Bitwise Operators Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Shift & Bitwise Operators" Watch "Shift & Bitwise Operators" New topic

Shift & Bitwise Operators

John Uhlig

Joined: May 12, 2003
Posts: 13
Can someone provide me with some real world examples of where shift and bitwise operators might be used? I understand (kinda) what they are doing, but can't think of when they would be used.
Also, is there a good webpage to explain them in more detail? I need to understand the whole shift and bitwise thing better.
John Hembree
hired gun
Ranch Hand

Joined: Mar 07, 2003
Posts: 250

I haven't used anything with shifting other than for simple multiplication and division but I have used the bitwise operators to compare bit values from Microsoft's Active Directory. Certain account properties are masked and the different bits represent specific account attributes.
Here's a web page from Microsoft on ADSI with AD, look for the section called "Putting the Pieces Together"
[ June 04, 2003: Message edited by: John Hembree ]
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
You might want to try a quick search on this forum for past conversations on this topic. I know we've brewed over it a few times.
Also, if ya haven't yet discovered it, you might want to take a look at the "Cat and Mouse Games with Bits" story over in The JavaRanch Campfire Stories.
Good luck.

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
I agree. Here's the link:
subject: Shift & Bitwise Operators
It's not a secret anymore!