Discover bitwise complement operator in java, include the articles, news, trends, analysis and practical advice about bitwise complement operator in java on alibabacloud.com
operator List
Arithmetic Operators
+ addition-add operator on both sides of the value-subtraction-left operand minus right operand* Multiplication-multiply operator on both sides of the value/division-left operand divided by right-hand operand%
Bitwise operations in Java
Java bit operator
Bitwise operators are used to operate binary bits. Java provides bitwise operators as shown below:
Bitwise operator (>>,>>,&, |, ^ ,~ ), In the bitwise operator, ~ The others are binary operators. The
------Java Training, Android training, iOS training,. NET training, look forward to communicating with you! -------"#include指令"1. The file contains the format of the command:1) #include "" Double quotation marks are files that contain the user's own
The difference between the source code, the reverse code, and the supplementary code in Java >>>> and the reverse code.
When I analyzed the HashMap hash algorithm two days ago, I met the >>and >> symbols. At that time, I checked the information and
Bitwise OperatorsJava defines a number of bitwise operators that can be applied to integer types Long,int,short,char and byte.Bitwise operators are performed on BITS and perform bitwise operations. Suppose a = 60 and B =; now in binary format, they
Bitwise operators defined by Java performs operations on digits of the integer type directly. These integer types include long, Int, short, Char, and byte. Table 4-2 lists bitwise operations:Table 4.2-bit operators and their results
Operator result~
Before you understand the displacement, look at the binary representations and relationships of positive and negative numbers:Example 15 and-15:15 The original code: 00000000 00000000 00000000 00001111Complement: 11111111 11111111 11111111 11110000+1
The main conclusion Java operation of the bitwise operator. java bitwise operators are not tight can improve operational efficiency, but also have unexpected effects (java.util.ArrayDeque has a good embodiment), in the follow-up will be illustrated.
Original Author: Rosen Jiang Source:Http://www.blogjava.net/rosen
Shift Operator
Including:"> Right shift"; ">> unsigned right shift"
Example:-5> 3 =-11111 1111 1111 1111 1111 1111 11111111 1111 1111 1111 1111 1111 1111The result is exactly the same
One of the most basic uses of computers is to perform mathematical operations, and as a computer language, Java also provides a rich set of operators to manipulate variables. We can divide the operators into the following groups:
Arithmetic
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.