This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes Java in General and the fly likes ShiftWise operator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic
Author

ShiftWise operator

Vidya Lakshman
Greenhorn

Joined: Apr 09, 2008
Posts: 11



what is the output of the above code & explain the working? Why is the code highlighted giving -ve value as the output?
Any help is highly appreciated.


Regards
Vidya
Don Redd
Ranch Hand

Joined: Jan 05, 2012
Posts: 82

1073741818 => 00111111 11111111 11111111 11111010
-24 ====> 11111111 11111111 11111111 11101000
-6 ====> 11111111 11111111 11111111 11111010

+24 ====> 00000000 00000000 00000000 00011000
+6 ====> 00000000 00000000 00000000 00000110

and you can use below URL to work out

http://docs.oracle.com/javase/tutorial/java/nutsandbolts/op3.html
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40029
    
  28
I shall take the liberty of closing this thread; read this.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ShiftWise operator