![]() In Java, negative numbers are stored as 2's complement. For example, if the number is positive then 0 will be used to fill the trailing positions and if the number is negative then 1 will be used to fill the trailing positions.Īssume if a = 60 and b = -60 now in binary format, they will be as follows − a = 0000 0000 0000 0000 0000 0000 0011 1100ī = 1111 1111 1111 1111 1111 1111 1100 0100 The signed right shift operator '>' uses the sign bit to fill the trailing positions. The left operands value is moved right by the number of bits specified by the right operand. ![]() The > operator is a signed right shift operator and > is an unsigned right shift operator. Java supports two types of right shift operators.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |