Ternary Operator in Java






This article is about how and when to use the if-else ternary operator in our java program or any other programming language. My approach here is to elaborate on this to ease the new programmers to write less as the shorthand if-else is often used to replace our traditional if and else statement. The ternary operator in java is not an operator but an if-else statement that works on three operands. Let’s try to go in more depth. There are some subheadings I am adding to be more ease for you to quickly access.


1. What is it and why is it this?

2. What does it consist of?

What is it and why is it?

What does it consist of?

Let’s understand with a picture,

Post a Comment

0 Comments