Session 5 (Expression and Assignments Statements)
December 16th, 2016 - Posted by: vaniasalsabella in Uncategorized- Java
- Operator – Operand
5 + 3
Ket. 5, 3 = operand
+ = operator
- Unary : 1 operand
- Binary : 2 operand
- Ternary : 3 operand
- Overloaded Operator (perjumlahan matriks)
Tidak diperlukan karena – tidak rapi, menghindari error, rumit
Conversion
- Narrowing – float ” int
- Widening – int ” float
- Char 1 int
Relational & Boolean Expression
< less than
> greater than
≤ less than or equal with
≥ greater than or equal with
== equal with
!= not equal
Logical Expression
&& and
|| or
!= negation
Short Circuit Evaluation
Digunakan untuk menghentikan operasi matematika dengan logical expression atau bitwise operator
Assignment Statement
Statement yang berisi perintah, diakhiri dengan semicolon (;)
- Mixed Node Assignment
- Cara Kerja
- Fetching – mengambil operand
- Execute – melihat operator
Cara Konversi
- Implisit – langsung diconvert
- Explisit – melalui variable