I need the code logic for the following:
These are the three String variables,
String s1 = "A"; String s2 = "B"; String s3 = "C";
I need to have the following outputs based on the given scenarios:
- Scenario #1 Actual output should be “A / B / C”
- Scenario #2 When s1 is empty, output should be “B / C”
- Scenario #3 When s2 is empty, output should be “A / C”
- Scenario #4 When s3 is empty, output should be “A / B”`
Is this possible using ternary operation?
You can do:
See it