Can any one explain the differences between <<,>>,>>> operators with example?
How can I store and manipulate unsigned bytes in Java? Location: http://www.jguru.com/faq/view.jsp?EID=13647 Created: Feb 12, 2000 Modified: 2000-02-13 22:24:52.048 Author: Robert Baruch (http://www.jguru.com/guru/viewbio.jsp?EID=11296) Question originally posed by Tim Rohaly PREMIUM (http://www.jguru.com/guru/viewbio.jsp?EID=10 The wacky thing about Java is that bytes, shorts, ints, and longs are all signed. Thus, the code: byte b = 0xAA; will generate an error (rather than a warning): possible loss of precision found : int required: byte byte b = 0xAA; More’s the bummer, there’s no unsigned keyword in Java. This is obviously of great consternation and gnashing of teeth to C/C++ programmers who are used to reading in files as streams of unsigned bytes, or generating unsigned bytes, or saving space by using unsigned bytes. In the Java Virtual Machine, bytes, shorts and ints are all four bytes long. Hence, when you add two bytes together you are actually performing 32-bit arithmatic. An