File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Android Security Essentials Live Lessons this week in the Android 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: 38025
    
  22
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
 
Similar Threads
Internal Implementation of Set (Collection) in java.
java Script Program
Want to convert my code in method
iterate problem in struts2
ShiftWise operator