my dog learned polymorphism*
The moose likes Java in General and the fly likes Use of shift operators in Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Use of shift operators in Java" Watch "Use of shift operators in Java" New topic

Use of shift operators in Java

Debopam Poddar
Ranch Hand

Joined: Jun 21, 2005
Posts: 49

Can you please expalin me the practical use of Java shift operators (>> , <<). When to use these operators and why?
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 38107
Try this old thread. If you need more information, ask again
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

shift operators are use in Integer arithmetic calculation to make fast calculation.

Have a look the source code of java.util.Integer . this class uses shift operators much.
It is sorta covered in the JavaRanch Style Guide.
subject: Use of shift operators in Java
Similar Threads
SIGNED Left Shift operator???
need tips and tricks/link on shift parameters
shift operators
how to use Random( )?
Application of shifting operators