Java Basics
Variables
In Java, there are different types of variables :
1. String: "Text" => Array of character
2. int: "Number"
3. float: "Decimals Number"
4. char: "single character"
5. boolean: "returned true or false"
Syntax : type variable = value ;
Operators
| Operators | Precedence | |
|---|---|---|
| postfix | expr++ expr– | |
| unary | ++expr –expr +expr -expr ~ ! | |
| multiplicative | * / % | |
| additive | + - | |
| shift | « » »> | |
| relational | < > <= >= instanceof | |
| equality | == != | |
| bitwise AND | & | |
| bitwise exclusive OR | ^ | |
| bitwise inclusive OR | ||
| logical AND | && | |
| logical OR | ||
| ternary | ? : | |
| assignment | = += -= *= /= %= &= ^= | = «= »= »>= |
IF-statment
Using to compare between to falue of to fix the value is true or not. We can’t show the body of if statment if the condition is false.
For loop
Using L[p To Fixed Or Check any thing many time like to fix an array if the value is even or odd. This is a basic Example:)