These are very similar to what you would use in JS with a little difference
public class Main {
public static void main(String[] args) {
int age = 37;
String truthy = age > 20 ? "true":"false";
System.out.println(truthy); // true
}
}
The operator requires a variable / data type assigned to it like so:
String truthy = age > 20 ? "true":"false";