+ 1
Can anyone help me with this please? I need OR to work like an else if. Thanks
public class Program { static void txt(String x){System.out.print(x);} public static void main(String[] args) { int j = 14 ; while(j>0){txt( j>5? " " : j>6? || j>9 "." : "*" );--j;} }}
2 Answers
+ 4
ternary operator is suitable for simple if statements. what u r doing is against the purpose of its definition.
+ 4
btw use ()