| Author |
bit shifting example
|
Mathew Lee
Ranch Hand
Joined: Jun 08, 2009
Posts: 238
|
|
I was looking at following example from link
http://www.jchq.net/certkey/0501certkey.htm
public class Shift2{
static int i=2;
public static void main(String argv[]){
System.out.println(32 % 32);
System.out.println( 3 >>> 32);
}
}
I clearly did not understood output.
I have not understood concepts behind >>>, >>,<<<,<<
Any ideas, resources,sample code,links, highly appreciated. thanks in advance.
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12953
|
|
Have a look at the tutorials: Bitwise and Bit Shift Operators.
Note: The <<< operator does not exist. Only: >>, >>> and <<.
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32833
|
|
|
And what output do you get? What did you expect?
|
 |
 |
|
|
subject: bit shifting example
|
|
|