It illustrates the usage of comparison operators on integer data type values.
It illustrates the usage of comparison operators on integer data type values.
Boolean values can hold any either of these values: true or false.
Logical Or gives true if either of the operands is true. Or even when both are true. Else, its false.
This example illustrates all the arithmetic operators and how they work on integer variables.
Here we make a example for a class called Student. And some basic accessor and mutator methods
Ternary Operator(?:) is an alternative to a simple if else statement.
Like in if-else we check for certain condition and make statement execute according to
result.
Shorthand Operators
Java provides special operators that can be used to combine an arithmetic operation with an assignment.
Like if we have a statement like following statement
a=a+4;
The ++ and the -- are java's increment and decrement.
The increment operator increases its operand by one.
While decrement operator decreases its operand by one.
This example illustrates the evaluation of arithmetic expression based on associativity of operators.
Special Operator called Dot Operator in Java:-
"The dot" connects classes and objects to members.
The places where you use it in what I cover are:
String Concatenation:-
This binary operator will concatenate one string to another.
Example:
String str1 = "abc";
String str2 = "def";
String str3 = str1 + str2