Top "Conditional-operator" questions

The conditional operator is a ternary operator that is part of the syntax for a basic conditional expression in several programming languages.

Is it possible to use EL conditional operator in action attribute?

The conditional operator works in many attributes like "rendered" "value" and others. But it does not work in action? Or …

jsf action el conditional-operator
Java ternary (immediate if) evaluation

I can't find the relevant portion of the spec to answer this. In a conditional operator statement in Java, are …

java conditional-operator short-circuiting
getting error: cannot take the address of an rvalue of type 'int'

I tryed to compile old code with new compiler and got the next error: error: cannot take the address of …

c gcc ternary-operator conditional-operator addressof
Return type of '?:' (ternary conditional operator)

Why does the first return a reference? int x = 1; int y = 2; (x > y ? x : y) = 100; While the second does …

c++ types reference conditional-operator lvalue
Conditional operator assignment with Nullable<value> types?

EmployeeNumber = string.IsNullOrEmpty(employeeNumberTextBox.Text) ? null : Convert.ToInt32(employeeNumberTextBox.Text), I often find myself wanting to do things like this (…

c# conditional-operator nullable
Booleans, conditional operators and autoboxing

Why does this throw NullPointerException public static void main(String[] args) throws Exception { Boolean b = true ? returnsNull() : false; // NPE on …

java nullpointerexception boolean conditional-operator autoboxing
?: ternary conditional operator behaviour when leaving one expression empty

I was writing a console application that would try to "guess" a number by trial and error, it worked fine …

c ternary-operator conditional-operator ternary
How to write a ternary operator (aka if) expression without repeating yourself

For example, something like this: var value = someArray.indexOf(3) !== -1 ? someArray.indexOf(3) : 0 Is there a better way to write that? …

javascript conditional-operator
C# interpolated string with conditional-operator

I tried to use the conditional operator inside an interpolated string, but because it has a colon in it, the …

c# conditional-operator string-interpolation