JAVA
java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* example for discuss forum
https://www.sololearn.com/Discuss/3193079/?ref=app
formatted to fit my phone screen
with ternary, think of '?' as if (following the condition instead of coming before it) & ':' as else
standard:
if (i > 5){
do this
else
do that
ternary:
(i>5) ? do this : do that
nested ternary:
(i==0) ? do this:
(i==1) ? do this:
(i==2) ? do this:
(i==3) ? do this: do that
*/
public class Program
{
public static void main(String[] args) {
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run