Java Bootcamp: Learn the Basics of Java Programming in 2 Weeks (2014)
Chapter 4. Useful Tables, Keep them Handy
This chapter contains the different tables that you need to keep handy because they serve as your quick reference in learning Java. If you can memorize them quickly, then it’s so much better.
Java Numeric Operators
Most programming languages use the same symbols for their numeric operators. If you already know a modern programming language, then you will notice that the signs for numeric operators of Java are mostly the same with that of the programming language that you are familiar with.
JAVA NUMERIC OPERATORS |
||
Sign |
Operand |
Example |
+ |
Addition |
8 + 7 |
- |
Subtraction |
26 - 9 |
* |
Multiplication |
9*5 |
/ |
Division |
81/3 |
% |
Remainder |
23%3 |
Java Comparison Operators (also known as Relational Operators)
If you are familiar with the comparison operators of other modern programming language, then memorizing the table below would be easy.
JAVA COMPARISON OPERATORS |
|
less than |
< |
less than or equal to |
<= |
greater than |
> |
greater than or equal to |
>= |
equal to |
== |
not equal to |
!= |
Boolean Logical Operators
The boolean logical operators are different from the comparison operators, be careful when using them.
BOOLEAN LOGICAL OPERATORS |
|
NOT |
! |
AND |
&& |
OR |
|| |
EXCLUSIVE OR |
^ |
The Different Truth Tables
TRUTH TABLE FOR 'NOT' |
|
A |
!A |
False |
True |
True |
False |
TRUTH TABLE FOR 'AND' |
||
E1 |
E2 |
E1 && E2 |
False |
False |
False |
False |
True |
False |
True |
False |
False |
True |
True |
True |
*E1 means expression 1 and E2 means expression 2, it’s the same with the rest of the tables.
TRUTH TABLE FOR 'OR' |
||
E1 |
E2 |
E1 || E2 |
False |
False |
False |
False |
True |
True |
True |
False |
True |
True |
True |
True |
TRUTH TABLE FOR 'EXCLUSIVE OR' |
||
E1 |
E2 |
E1 ^ E2 |
False |
False |
False |
False |
True |
True |
True |
False |
True |
True |
True |
False |
It would be better if you could memorize the different tables right away so you don’t need to look whenever you need to confirm something. You will need the tables for the lessons in the succeeding chapters.