Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Binary rep of negative numbers in Java - 2's complement

2's Complement: Binary representation of Negative Numbers in JavaNegative numbers in Java are represented using 2's complement. As we know that integers in Java occupy 4 bytes so to understand how a negative integer (say -4) is represented internally in Java, we first need to find the binary equivalent of the positive value of the integer (in this case 4) and subsequently by finding the 2's



This post first appeared on Geek Explains: Java, J2EE, Oracle, Puzzles, And Problem Solving!, please read the originial post: here

Share the post

Binary rep of negative numbers in Java - 2's complement

×

Subscribe to Geek Explains: Java, J2ee, Oracle, Puzzles, And Problem Solving!

Get updates delivered right to your inbox!

Thank you for your subscription

×