Description:
In computer programming, ?: is a ternary operator that is part of the syntax for a basic conditional expression in several programming languages. It is commonly referred to as the conditional operator, inline if (iif), or ternary if.

It originally comes from CPL, in which equivalent syntax for e1 ? e2 : e3 was e1 → e2, e3.
Learn through my videos:

Program:
packageternaryoperator;
public class Ternaryoperator {

public static void main(String[] args) {
        Object obj1;
        Object obj2;

if(true)
        {
            obj1=new Integer(10);
        }
else
        {
              obj1=new Double(15.0);
        }
System.out.println(obj1);
        obj2=true?new Integer(10):new Double(15.0);
System.out.println(obj2);
    }

}
Output:
10
10.0
Logic:
For Example:
minVal = (a < b) ? a : b;