Operators in Java
In Java, operators are exclusive symbols that function sure operations on one or extra operands (variables, values, or expressions).
Here are some of the primary classes of operators in Java:
Arithmetic Operators:-
Arithmetic operators operate simple arithmetic operations such as addition, subtraction, multiplication, division, and modulus (remainder)
Examples:
+ addition operator
- subtraction operator
* multiplication operator
/ division operator
% modulus operator
Relational Operators:-
Relational operators are used to examine two values or expressions and return a boolean cost of both proper or false.
Examples:
> higher than operator
< much less than operator
>= increased than or equal to operator
<= much less than or equal to operator
== equal to operator
!= no longer equal to operator
Logical Operators:-
Logical operators are used to mix more than one stipulations or boolean expressions and consider them to a single boolean value.
Examples:
&& logical AND operator
|| logical OR operator
! logical NOT operator
Assignment Operators:-
Assignment operators are used to assign values to variables.
Examples:
= easy challenge operator
+= addition challenge operator
-= subtraction undertaking operator
*= multiplication undertaking operator
/= division project operator
%= modulus challenge operator
Bitwise Operators:-
Bitwise operators operate operations on the binary illustration of integer values.
Examples:-
& bitwise AND operator
| bitwise OR operator
^ bitwise XOR operator
~ bitwise complement operator
<< left shift operator
>> proper shift operator
>>> unsigned proper shift operator
Conditional Operator:-
Conditional operator is a ternary operator that operates on three operands and is used to consider a boolean expression.
Examples:
? : conditional operator
Instanceof Operator:-
Instanceof operator is used to test whether or not an object is an occasion of a specific classification or not.
Example:
object instanceof class