JAVA BASIC OPERATORS
Java provides a rich set of operators to manipulate variables. We can divide all the Java operators into the following categories.- Arithmetic operators.
- Relational operators
- Bitwise operators.
- Logical operators.
- Assignment operators.
- Misc operators.
( WAnt to know About Basic of JAVA click on this link ).
http://technolgydrift.blogspot.com/2018/07/difference-betwen-java-snd-javascript.html
( Want to know about difference between java and javascript click on this link ).
1. The Arithmetic Operators.
Arithmetic operators are used in mathematical expressions in the same way that they are used in algebra.
Assume integer variable A holds 10 and variable B holds 20 , then..
2. Relational Operators.
There are following relational operators supported by java language.
Assume variable A holds 10, and variable B holds 20, then..
3. Bitwise Operators.
Java defines several bitwise operators, which can be applied to the integer types, long, int, short, char, and byte..
Bitwise operators works on bit and performs bit by bit operation. Assume if A = 60 and B = 13, now in binary format they will be as follows .
A = 0011 1100
B = 0000 1101
A&B = 0000 1100
A|B = 0011 1101
A^B = 0011 0001
!A = 1100 0011
Assume integer variable A holds 60 and variable B holds 13, then
4. Logical Operator.
Assume Boolean variables A holds true and variable B holds false, then
Following are the assignment operators supported by java language.
1. ( = ) Assigns value from right side operand to left side operand.
C = A+B will assigns value of A+B into C.
2. ( += ) ADD AND assignment operator. Its ADD right operand to the left operand and assign the result to left operand.
C+=A equal to C = C+A .
3. ( -= ) Subtract AND assignment operator. Its subtract right operand from the left operand and assign result to the left operand.
C-=A equal to C=C-A
4. ( *= ) Multiply AND assignment operator. It multiplies right operand with the left and assign the result with the left operand.
C*=A equal to C=C*A
5. ( /= ) Divide AND assignment operator. It divides right operand with the left and assign the result with the left operand.
C/=A equal to C=C/A
6. ( %= ) Modulos AND assignment operator. It divides right operand with the left and assign the result with the left operand.
C%=A equal to C=C%A
7. ( <<= ) Left Shift AND assignment operator
C<<=2 is same as C = C<<2
8. ( >>= ) Right Shift AND assignment operator
C>>=2 is same as C = C>>2
Misc Operator.
Conditional operator
Conditional operator is also known as ternary operator. This operator consists of three operand and is used to evaluate boolean expressions. The goal of the operator is to decide, which value should be assigned to the variable..
https://chat.whatsapp.com/LQwOhM1jvx25uNG5LXxU2f
If you are interested in this and want to learn more about Internet Networking Programming language and Technologies then join my whatsapp group by this link.
for car removal services visit Car Removals Sydney
ReplyDelete