what is the difference between binary and ternary operators in Java?
Answers
Answered by
25
Binary operator deals with two operands and one operator(an Arithmetic operator).
ex- a+B,a-b
Ternary operator deals with three operands and two operator (it is an logical expression).
ex-if(a>B)
d=(a-b);
else
d=(b-a);
Ternary- d=(a>b)?(a-b):(b-a);
ex- a+B,a-b
Ternary operator deals with three operands and two operator (it is an logical expression).
ex-if(a>B)
d=(a-b);
else
d=(b-a);
Ternary- d=(a>b)?(a-b):(b-a);
Rakshiknr:
please mark as brainliest answer please
Answered by
1
Answer:
Binary Operator, which deals with two operands, is known is known as the Binary operator.
Ternary operator deal with three operands. It is also called the assignment statement because the value assigned to a variable depends upon a logical experation.
Explanation:
Please Mark It As Brainliest.
Please I am requesting.
I hope this answer is helpful.
Similar questions