Академический Документы
Профессиональный Документы
Культура Документы
Arithmatic Operators
+
*
/
%(remainder)
++ (incr
ement by 1)
-- (decrement by 1)
we also have pre & post increment operator e.g. ++x (pre) & x++ (post).
Relational Operators
>
<
>=
<=
==
!=
they compare two vlaues. Binary operators, and their operands are numeric expres
sions. The results of relational operators can be stored in a BOOLEAN Variable.
e.g.
boolean tooBig = (x>=hiValue);
Logical Operators
&& (AND)
|| (OR)
&
|
^ (XOR)
Returns True or false value based on the state of the variables.
XOR - ((X||Y) && !(X&&Y)). Either X or Y is true provided X & Y are NOT True i.e
. Both X & Y cannot be true (mutually exclusive). One has to be true and other h
as to be false.
The && and || operators use short-circuit evaluation i.e. if the left operand de
termines the outcome, then right operand expression is not evaluated. Note the f
ollowing
- for && Operator, the RHS expression is performed only when the LHS expression
is TRUE.
- for || Operator, the RHS expression is performed only when LHS is false.
This acts bit like an IF Statement.
Unary Operators
++
--
==============================================
================================================================================
==============================================
================================================================================
==============================================
================================================================================
==============================================
================================================================================
==============================================
================================================================================
==============================================
================================================================================
==============================================
================================================================================
==============================================
================================================================================
==============================================
================================================================================
==============================================
================================================================================
==============================================
================================================================================
==============================================
================================================================================
==============================================
================================================================================
==============================================
================================================================================
==============================================
================================================================================
==============================================
================================================================================
==============================================
================================================================================
==============================================
================================================================================
==============================================
================================================================================
==============================================
CONTROL FLOW STATEMENTS
Switch Statement: Byte, Short, Char & Int.
For Statement
While Statement
Do While Statement
Method Overloading: Using Same Method Name with different parameters.