Reading time: 5 minutes
Previous Chapter >>>> Datatypes and Variables

Classification of Java Operators:
Unary operators: Needs one Operand. ex: int next = i++;
Binary operators: Needs two Operands. ex: int sum = a + b;
Ternary operators: Needs three Operands. ex: if(next == sum) ? true : false
Commonly used Operators in Java:
Assignment Operators : '='
Conditional Operator : '?'
Relational Operators : '>', '<', '>=', '<=', '==', '!='
Arithmetic Operators : '-', '+', '*', '/', '%', '++', '--'
Logical Operators : '&&', '||', '&', '|', '!', '^'
Next Chapter >>>> Decision making in Java
Sample program using Operators in Java:
No comments:
Post a Comment
Thanks a lot for your valuable Comment!