What is the syntax for using the ternary operator `?:` in Java?
The syntax is: `condition ? expression1 : expression2;` where `expression1` is returned if the condition is true, and `expression2` is returned if false.
Impressive! You've correctly explained the syntax of the ternary operator.
Can you explain how the ternary operator handles different data types between `expression1` and `expression2`?