if ($a==1) {
print "A is 1!";
} else {
print "A is not 1!";
}
Cool, huh?
public class !CondOpTest? {
public static void main(String[] args) {
}
public !CondOpTest?(Integer a) {
if (a.intValue()==1) {
System.out.println("A is 1!");
} else {
System.out.println("A is not 1!");
}
}
}
public class !CondOpTest? {
public static void main(String[] args) {
}
public !CondOpTest?(Integer a) {
System.out.println((a.intValue()==1 ) ? "A is 1!" : "A is not 1!");
}
}
In Perl, however, things are slightly different.
The above also works in C
int a = 0; (a == 1) ? printf("A is 1!\n") : printf("A is not 1!\n");
No page links to TernaryOperator.
lib/plugin/WlugLicense.php:99: Warning: Invalid argument supplied for foreach()
lib/plugin/WlugLicense.php:111: Warning: in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument