Basic Java for Testers | Ch-2 | Operators in Java

Reading time: 5 minutes

Previous Chapter >>>> Datatypes and Variables
Operators are user to perform specific operations / calculations among one or more operands / 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:


Basic Java for Testers | Ch-2 | Operators in Java Basic Java for Testers | Ch-2 | Operators in Java Reviewed by Ishan Dev Shukl on March 22, 2018 Rating: 5

No comments:

Thanks a lot for your valuable Comment!

Powered by Blogger.