Ternary/Conditional Operator | Java

3 days ago

The example I gave around the 3:00 min mark, it should look like this
The line should look like this:
System.out.println("Your a " + ((gender == "M")? "Male": "Female"));
and not
System.out.println("Your a " + (gender == "M")? "Male": "Female");

Loading comments...