Operators in Java

Arithmetic And Unary Operators in Java

Arithmetic operators are used to perform basic mathematical operations like addition, subtraction, multiplication, and division. Unary operators are used with only one operand, such as increment (++), decrement (--), and negation (-).

Equality And Relational Operators in Java

Equality operators (==, !=) are used to compare two values. Relational operators (>, <, >=, <=) are used to compare two values and determine the relationship between them.

Conditional Operators in Java With Examples

Conditional operators include logical AND (&&), logical OR (||), and logical NOT (!). They are used to combine multiple conditions in decision-making statements.

Ternary Operator in Java With Examples

The ternary operator (?:) is a shorthand for the if-else statement. It takes three operands and returns a value based on a condition.

instanceof Operator in Java With Examples

The instanceof operator is used to test whether an object is an instance of a specific class or subclass.

Difference Between equals() Method And equality Operator == in Java

The equals() method is used to compare the contents of two objects, while the == operator compares the references of two objects.