Java Ternary Operator (manohar academy)

Опубликовано: 05 Апрель 2026
на канале: ManoharAcademy
96
2

Welcome to manohar academy.

In this lesson we are going to learn about java ternary operator also called conditional operator. Ternary operator operates on 3 operands. If the boolean value of the first operand is true then the first expression (second operand) is evaluated, other wise second expression (third operand) is evaluated. The data type of the result produced by ternary operator depends on both expressions.

Simple use cases for ternary operator are also discussed.

The source files can be obtained from
https://github.com/nncmanohar/CoreJava

visit my website : http://manoharacademy.com

java fundamentals : https://goo.gl/iN5oLb
java arrays : https://goo.gl/v2LUpf
java class design : https://goo.gl/IQbfRk
java inheritance : https://goo.gl/l1wDOO