Chapter 3 - Java Basic Operators
Chapter 3 - Java Basic Operators
Output:
Addition Result: 30
Substraction Result: 10
Division Result: 2
Ex. ++x
negating an expression
Ex. --x
== Equal to x == y
!= Not equal x != y
These operators are used to perform “logical AND” and “logical OR” operation,
i.e. the function similar to AND gate and OR gate in digital electronics. One thing
to keep in mind is the second condition is not evaluated if the first one is false, i.e.
it has a short-circuiting effect. Used extensively to test for several conditions for
making a decision.
! Logical not Reverse the result, returns false if the result is true
Bitwise Compliment ~ ~ op
int n1 = 5, n2 = 11, n3 = 7;
Output:
Largest Number: 11
class Employee {
Output:
true
customer.customerName;
customer.showCustomerList();