Bitwise AND Operator:&
Grammar
Expression
&
expression
NoteAn expression can be another "and" expression, or (follow the type restrictions described below) equality expressions, relational expressions, addition expressions,
Bitwise operators allow you to evaluate and manipulate the bits specified in the integer number.
Bitwise operators
Example name result
$a & $b and (bitwise AND) will set the 1 bit in the $a and $b to 1.
$a | $b or (bitwise OR) sets any bit in the
Why can I use the bitwise operation of the enumeration?1. What is a bitwise operation in an enumeration?For exampleint a = 1 int b = 1 int c = 1 int d = 1 and arithmeticA | B0110--------------11 ==1+2int value = A | bNSLog (@ "%d,%d,%d,%d", Value &
Note: The article is reproduced in the network.C-priority list
Precedence
Operator
Description
Example
Associativity
1 () [] -> . :: + + - -
Grouping operator Array access Member access
Precedence
Operator
Description
Example
associativity
1
()[]-.::++--
Grouping operatorArray AccessMember access from a pointerMember access from a objectScoping operatorPost-incrementPost-decrement
(A
Arithmetic operators1. Arithmetic operators: +,-, *,/, and %.2. Increment/decrease operators: for example, $ a ++, $ a --, ++ $ a, -- $.For example: The code is as follows:Copy code $ A = 10;$ B = 5;$ C = $ a ++; // assign values first and then
Precedence
Operator
Description
Example
associativity
1
()[]->.::++--
Grouping operatorArray Accessmember access from a pointermember access from an objectScoping operatorPost-incrementPost-decrement
(A + B)/4;
Transferred from original: http://www.yiibai.com/java/java_basic_operators.htmlJava provides a set of operator-rich manipulation variables. We can put all the Java operators into the following groups:
Arithmetic operators
Relational
2.2 Data Type 2.2.1 Java data type 2.3 common operatorsJava provides a set of operator-rich manipulation variables. We can put all the Java operators into the following groups:
Arithmetic operators
Relational operators
Bitwise
int x = 0;if (x = 0 | | x = = 0) printf ("%dn", x);p rintf ("%dn", X);
The priority table for reference C is actually if (x = (0 | | x = = 0))Will printf out two 1.Operators of the same precedence, the order of operations is determined by the
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.