Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Importance of Bitwise Operators

 
Mubeen Shaik
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am new to Java and learing java. I want to know the importance of Bitwise operators (Shift left , Shift Right). Are these really useful in a business application?

Thanks,
Shaik.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've usually used them in other languages in much lower-level stuff, interpreting flags and bitmaps from the operating system. I made a little class to convert from IBM mainframe packed decimal to integer the other day that used shift, & and | operations, again pretty low-level. Any other typical applications out there?
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shaik,
Welcome to JavaRanch!
We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.
Thanks Pardner! Hope to see you 'round the Ranch!
 
Maarten Vergouwen
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The bitwise operators are very rarely used in business applications.
Their main advantage is speed, so they are used quite a lot in graphics-heavy applications (like games).
In business-apps they are a liability in my opinion, as they hide logic in a very obscure, hard-to-decipher-afterwards way.
 
Jason Cox
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In five years I have yet to use them in a single functional program that I've written.
However, it might be useful to learn them, at least well enough to pass certification, because you never know when you might end up at a job where that kind of knowledge might be useful.
 
Mubeen Shaik
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Dirk Schreckmann:
Shaik,
Welcome to JavaRanch!
We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.
Thanks Pardner! Hope to see you 'round the Ranch!

Dirk Schreckmann,
Shaik is my last name.
Thanks
Shaik.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic